Skip to content

Commit

Permalink
Snap workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanGriffiths committed Aug 14, 2024
1 parent fa1ec73 commit b0c248a
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/close-snap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Close Snaps

on:
pull_request:
types: [closed]

jobs:
close:
runs-on: ubuntu-latest

timeout-minutes: 5

steps:
- name: Close obsolete channels
uses: canonical/actions/close-snap@release
continue-on-error: true
with:
channel: edge/pr${{ github.event.number }}
snapcraft-token: ${{ secrets.SNAPCRAFT_TOKEN }}
30 changes: 30 additions & 0 deletions .github/workflows/snap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Snap

on:
merge_group:
types: [checks_requested]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

jobs:
Snap:
runs-on: ubuntu-latest

timeout-minutes: 45

steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0 # needed for version determination

- name: Build and publish the snap
uses: canonical/actions/build-snap@release
with:
architecture: amd64
review-opts: --allow-classic
snapcraft-token: ${{ secrets.SNAPCRAFT_TOKEN }}
launchpad-credentials: ${{ secrets.LAUNCHPAD_CREDENTIALS }}
launchpad-accept-public-upload: true
publish: ${{ github.event_name == 'pull_request' && github.repository == github.event.pull_request.head.repo.full_name }}
publish-channel: edge/pr${{ github.event.number }}

0 comments on commit b0c248a

Please sign in to comment.