diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 4b3d37678..64cda8ba9 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -19,44 +19,20 @@ concurrency: jobs: build: name: Build snap - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Build snap locally - uses: snapcore/action-build@v1 - id: build + uses: canonical/data-platform-workflows/.github/workflows/build_snap.yaml@v22.0.0 - - name: Get snapcraft track - if: ${{ github.ref_protected }} - id: track - run: | - if [ "${{ github.ref_name }}" == "master" ]; then - echo "::set-output name=track::latest" - elif [[ "${{ github.ref_name }}" =~ ^stable\/(.+) ]]; then - TRACK_NAME=${BASH_REMATCH[1]} - echo "::set-output name=track::$TRACK_NAME" - else - echo "Branch name does not match expected patterns. Exiting." - exit 1 - fi - - - name: Upload snap artifact - id: upload-snap - uses: actions/upload-artifact@v4 - with: - name: snap - path: ${{ steps.build.outputs.snap }} - - - name: publish snap - if: ${{ github.ref_protected }} - uses: snapcore/action-publish@v1 - env: - SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} - with: - snap: ${{ steps.build.outputs.snap }} - release: ${{ steps.track.outputs.track }}/edge + release: + name: Release snap + needs: + - build + uses: canonical/data-platform-workflows/.github/workflows/release_snap.yaml@v22.0.0 + with: + channel: 1.17/edge + artifact-prefix: ${{ needs.build.outputs.artifact-prefix }} + secrets: + snap-store-token: ${{ secrets.SNAP_STORE_TOKEN }} + permissions: + contents: write # Needed to create GitHub release test-service: name: Test snap service @@ -66,7 +42,7 @@ jobs: - name: Download snap artifact uses: actions/download-artifact@v4 with: - name: snap + name: ${{needs.build.outputs.artifact-prefix}}-amd64 - name: Install snap run: | diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 8e712dd06..d6f07e76f 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -38,12 +38,6 @@ architectures: build-for: [amd64] - build-on: [arm64] build-for: [arm64] - - build-on: [armhf] - build-for: [armhf] - - build-on: [ppc64el] - build-for: [ppc64el] - - build-on: [s390x] - build-for: [s390x] package-repositories: