Skip to content

Commit

Permalink
chore: add snap related CI workflows
Browse files Browse the repository at this point in the history
Signed-off-by: guillaume <[email protected]>
  • Loading branch information
gruyaume committed Sep 6, 2024
1 parent ecb1a83 commit 235cb9f
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 9 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/build-snap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Build Snap

on:
workflow_call:

jobs:
build-snap:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- name: Build snap
uses: snapcore/action-build@v1
id: build

- name: Upload locally built snap artifact
if: ${{ github.ref_name == 'main' }}
uses: actions/upload-artifact@v4
with:
name: snap
path: ${{ steps.build.outputs.snap }}
25 changes: 16 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,35 @@ on:
jobs:
unit-test-frontend:
uses: ./.github/workflows/test-frontend.yaml
build-nextjs:
nextjs-build:
uses: ./.github/workflows/build-frontend.yaml
unit-test-notary:
needs: [build-nextjs]
go-unit-test:
needs: [nextjs-build]
uses: ./.github/workflows/test-notary.yaml
go-vet:
needs: [build-nextjs]
needs: [nextjs-build]
uses: ./.github/workflows/go-vet.yaml
go-lint:
needs: [build-nextjs]
needs: [nextjs-build]
uses: ./.github/workflows/go-lint.yaml
build-notary:
needs: [build-nextjs]
go-build:
needs: [nextjs-build]
uses: ./.github/workflows/build-notary.yaml
rock-build:
needs: [build-notary, unit-test-notary, go-vet, go-lint]
needs: [go-build, go-unit-test, go-vet, go-lint]
uses: ./.github/workflows/build-rock.yaml
rock-scan:
if: github.ref_name == 'main'
needs: [rock-build]
uses: ./.github/workflows/scan-rock.yaml
publish:
rock-publish:
if: github.ref_name == 'main'
needs: [rock-build]
uses: ./.github/workflows/publish-rock.yaml
snap-build:
needs: [go-build, go-unit-test, go-vet, go-lint]
uses: ./.github/workflows/build-snap.yaml
snap-publish:
if: github.ref_name == 'main'
needs: [snap-build]
uses: ./.github/workflows/publish-snap.yaml
32 changes: 32 additions & 0 deletions .github/workflows/publish-snap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Publish Snap

on:
workflow_call:

jobs:
publish-snap:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- name: Downloads locally built snap artifact
uses: actions/download-artifact@v4
id: download
with:
name: snap

- name: Determine snap file name
id: find-snap
run: |
SNAP_FILE=$(ls *.snap)
echo "Found snap file: $SNAP_FILE"
echo "snap_file=${SNAP_FILE}" >>$GITHUB_OUTPUT
- name: Publish snap
uses: snapcore/[email protected]
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
if: ${{ github.ref_name == 'main' }}
with:
snap: ${{ steps.find-snap.outputs.snap_file }}
release: edge

0 comments on commit 235cb9f

Please sign in to comment.