📦 Publish to candidate #57
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 📦 Publish to candidate | |
on: | |
# Run the workflow each time new commits are pushed to the candidate branch. | |
push: | |
branches: [ "candidate" ] | |
# Allow the workflow to be started manually from the Actions tab. | |
workflow_dispatch: | |
# Allow the workflow to be started by another workflow. | |
workflow_call: | |
secrets: | |
SNAP_STORE_CANDIDATE: | |
required: true | |
# Permissions for GITHUB_TOKEN | |
permissions: | |
contents: read | |
issues: write | |
env: | |
# Use the name of the repo as the name of the snap | |
SNAP_NAME: ${{ github.event.repository.name }} | |
# Hardcoded git branch and Snap Store channel channel | |
CHANNEL: 'candidate' | |
jobs: | |
build: | |
name: "Build and publish snap" | |
environment: "Candidate Branch" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ env.CHANNEL }} | |
- uses: snapcore/action-build@v1 | |
id: build | |
- uses: diddlesnaps/snapcraft-review-action@v1 | |
with: | |
snap: ${{ steps.build.outputs.snap }} | |
isClassic: 'false' | |
- uses: snapcore/action-publish@v1 | |
env: | |
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_CANDIDATE }} | |
with: | |
snap: ${{ steps.build.outputs.snap }} | |
release: ${{ env.CHANNEL }} | |
create_issue: | |
name: "Create call for testing" | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: JasonEtco/create-an-issue@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
filename: .github/testing-issue-template.md |