-
Notifications
You must be signed in to change notification settings - Fork 9
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
Showing
2 changed files
with
14 additions
and
44 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 |
---|---|---|
|
@@ -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/[email protected] | ||
|
||
- 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/[email protected] | ||
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: | | ||
|
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