-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Merge build and push jobs - Eliminate artifact caching - Inline release channel logic - Filter branches with on.push rule
- Loading branch information
1 parent
8f685d9
commit ea8bf01
Showing
1 changed file
with
16 additions
and
41 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,23 @@ | ||
name: snapcraft | ||
|
||
on: push | ||
# This workflow publishes a snap on updates to the master and beta branch | ||
|
||
name: snapcraft | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- beta | ||
jobs: | ||
build: | ||
publish: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
snap-file: ${{ steps.build.outputs.snap }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: snapcore/action-build@v1 | ||
id: build | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: snap | ||
path: ${{ steps.build.outputs.snap }} | ||
|
||
push-master: | ||
needs: build | ||
runs-on: ubuntu-20.04 | ||
if: github.ref == 'refs/heads/master' | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: snap | ||
path: . | ||
- uses: snapcore/action-publish@master | ||
env: | ||
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_LOGIN }} | ||
with: | ||
snap: ${{needs.build.outputs.snap-file}} | ||
release: candidate | ||
push-beta: | ||
needs: build | ||
runs-on: ubuntu-20.04 | ||
if: github.ref == 'refs/heads/beta' | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: snap | ||
path: . | ||
- uses: snapcore/action-publish@master | ||
- uses: actions/checkout@v3 | ||
- name: Build snap | ||
uses: snapcore/action-build@v1 | ||
id: build | ||
- name: Publish to the Snap Store | ||
uses: snapcore/action-publish@master | ||
env: | ||
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_LOGIN }} | ||
with: | ||
snap: ${{needs.build.outputs.snap-file}} | ||
release: beta | ||
snap: ${{ steps.build.outputs.snap }} | ||
release: ${{ github.ref_name == 'master' && 'candidate' || 'beta' }} |