-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
91ec8a6
commit 37359b3
Showing
1 changed file
with
50 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: snap | ||
on: # The event that triggers the workflow | ||
push: | ||
branches: | ||
- master # When a commit is created on master | ||
pull_request: | ||
branches: | ||
- master # When a pull request is opened against master | ||
Workflow_dispatch: # Manually trigger the workflow | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
snap-file: ${{ steps.build-snap.outputs.snap }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build the snap # generates .snap file and stores its name in the variable steps.build-snap.outputs.snap | ||
uses: snapcore/action-build@v1 | ||
id: build-snap | ||
|
||
# Make sure the snap is installable | ||
- run: | | ||
sudo snap install --dangerous ${{ steps.build-snap.outputs.snap }} | ||
# Do some testing | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: ngrok | ||
path: ${{ steps.build-snap.outputs.snap }} | ||
|
||
publish: | ||
if: github.ref == 'refs/heads/main' | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Download package | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ngrok | ||
path: . | ||
- name: Publish to Snap Store | ||
uses: snapcore/action-publish@v1 | ||
env: | ||
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }} | ||
with: | ||
snap: ${{needs.build.outputs.snap-file}} | ||
release: edge |