chore: bump upf to 1.5.0 #128
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
name: Main branch workflow | |
on: | |
push: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build snap | |
runs-on: ubuntu-20.04 | |
outputs: | |
snap: ${{ steps.snapcraft.outputs.snap }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Build snap locally | |
uses: snapcore/action-build@v1.3.0 | |
id: snapcraft | |
- name: Upload locally built snap artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: snap | |
path: ${{ steps.snapcraft.outputs.snap }} | |
publish: | |
name: Snap publish | |
runs-on: ubuntu-22.04 | |
needs: build | |
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/action-publish@v1.2.0 | |
env: | |
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} | |
if: ${{ github.ref_name == 'main' }} | |
with: | |
snap: ${{ steps.find-snap.outputs.snap_file }} | |
release: 1.5/edge | |
- name: Publish developer snap to branch | |
uses: snapcore/action-publish@v1.2.0 | |
env: | |
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} | |
if: ${{ (github.ref_name != 'main') && (github.event_name == 'push') }} | |
with: | |
snap: ${{ steps.find-snap.outputs.snap_file }} | |
release: 1.5/edge/${{ github.ref_name }} |