Skip to content

Commit

Permalink
chore(ci): publish feature branches to edge/ (#1373)
Browse files Browse the repository at this point in the history
This is pretty much a copy-paste of the equivalent yaml from Rockcraft.

Fixes #1372
  • Loading branch information
tigarmo authored Nov 10, 2023
1 parent 543b595 commit 3877731
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: Tests

on:
push:
branches: [ main ]
branches:
- main
- "feature/**"

pull_request:

Expand Down Expand Up @@ -99,6 +101,24 @@ jobs:
with:
name: snap
path: ${{ steps.snapcraft.outputs.snap }}
- name: Get branch name
id: vars
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]
then
echo "branch=pr-${{ github.event.number }}" >> "$GITHUB_OUTPUT"
else
branch=$(echo ${GITHUB_REF#refs/*/} | sed -e 's|feature/\(.*\)|\1|')
echo "branch=$branch" >> "$GITHUB_OUTPUT"
fi
- name: Publish feature branch to edge/${{ steps.vars.outputs.branch }}
if: ${{ env.SNAPCRAFT_STORE_CREDENTIALS != '' }}
uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
with:
snap: ${{ steps.snapcraft.outputs.snap }}
release: edge/${{ steps.vars.outputs.branch }}

# Commented out until we can provide the necessary launchpad credentials.
# snap-remote-build:
Expand Down

0 comments on commit 3877731

Please sign in to comment.