Skip to content

Commit

Permalink
don't release feature branches
Browse files Browse the repository at this point in the history
  • Loading branch information
barrettj12 committed Oct 18, 2023
1 parent 0d98965 commit 7a4b257
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,15 @@ jobs:
case ${{ github.ref_name }} in
3.* | 4.*)
TRACK="${{ github.ref_name }}"
DO_RELEASE=true
;;
main)
TRACK="latest"
DO_RELEASE=true
;;
*)
TRACK="latest"
DO_RELEASE=false # Don't release feature branches
;;
esac
Expand All @@ -63,7 +69,9 @@ jobs:
BRANCH="${{ github.ref_name }}-${{ github.sha }}"
echo "test=$TRACK/edge/$BRANCH" >> "$GITHUB_OUTPUT"
echo "release=$TRACK/edge" >> "$GITHUB_OUTPUT"
if [[ "$DO_RELEASE" == 'true' ]]; then
echo "release=$TRACK/edge" >> "$GITHUB_OUTPUT"
fi
upload:
Expand Down Expand Up @@ -169,16 +177,14 @@ jobs:
run: |
sudo snap install charmcraft --classic
# TODO: check if track exists, otherwise don't upload

- name: Get uploaded revision
id: revision
run: |
charmcraft status $CHARM_NAME --format json |
jq ${{ needs.channel.outputs.release }} ...
- name: Release to edge
if: github.event_name == 'push'
if: github.event_name == 'push' && needs.channel.outputs.release != ''
run: |
charmcraft release $CHARM_NAME \
--revision=${{ steps.revision.outputs.revision }}
Expand Down

0 comments on commit 7a4b257

Please sign in to comment.