Skip to content

snap

snap #229

Workflow file for this run

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: # When the workflow is manually triggered
jobs:
build:
# Only run this job if the branch name contains "release" or a commit is created on master branch and the branch name contains "release" or manually triggered
if: contains(github.ref, 'release') || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-22.04
outputs:
snap-file: ${{ steps.build-snap.outputs.snap }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install snapcraft
run: |
sudo snap install snapcraft --classic
- uses: snapcore/action-build@v1
# Upload the snap file as an artifact
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ngrok-snaps
path: ./*.snap
publish:
# Only run this job if the branch name contains "release" or a commit is created on master branch and the branch name contains "release" or manually triggered
if: (github.event_name == 'push' && github.ref == 'refs/heads/master' && contains(github.ref, 'release')) || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-22.04
needs: build # Wait for the build job to complete
steps:
- name: Download All Snap Artifacts
uses: actions/download-artifact@v4
with:
path: ngrok-snaps
merge-multiple: true
- run: ls -R
# - name: Publish to Snap Store
# env:
# SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }}
# run: |
# sudo snap install snapcraft --classic
# for snap in ngrok/*.snap; do
# echo "Publishing $snap"
# snapcraft push "$snap" --release=stable
# done