Skip to content

Commit

Permalink
Merge pull request #25 from juju/release-ci
Browse files Browse the repository at this point in the history
[ci] add job to release to edge
  • Loading branch information
wallyworld authored May 10, 2023
2 parents 6391895 + 48f5119 commit e2e7502
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,47 @@ jobs:
juju status
# TODO: test integration with dashboard / ha-proxy

release:
name: "Release to edge"
runs-on: ubuntu-latest
needs: [build, bootstrap]
if: github.event_name == 'push'

steps:
- name: Download packed charm
id: download
uses: actions/download-artifact@v3
with:
name: ${{ needs.build.outputs.artifact-name }}

- name: Select Charmhub channel
id: channel
shell: bash
run: |
set -x
case ${{ github.ref_name }} in
3.* | 4.*)
TRACK="${{ github.ref_name }}"
;;
master)
TRACK="latest"
;;
esac
echo "track=$TRACK" >> "$GITHUB_OUTPUT"
if [[ -z $CHANNEL ]]; then
echo "upload=false" >> "$GITHUB_OUTPUT"
else
echo "upload=true" >> "$GITHUB_OUTPUT"
fi
- name: Upload to Charmhub
if: steps.channel.outputs.upload == 'true'
env:
CHARMCRAFT_AUTH: ${{ secrets.CHARMCRAFT_AUTH }}
run: |
sudo snap install charmcraft --classic
charmcraft upload ${{ steps.download.outputs.download-path }}/*.charm \
--release ${{ steps.channel.outputs.track }}/edge

0 comments on commit e2e7502

Please sign in to comment.