Release to Charmhub #7
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: Release to Charmhub | |
on: | |
workflow_dispatch: | |
inputs: | |
channel: | |
description: "The channel where the charm is going to be released to" | |
required: true | |
default: "stable" | |
type: choice | |
options: | |
- stable | |
- candidate | |
- beta | |
- edge | |
jobs: | |
release-to-charmhub: | |
name: Release to CharmHub | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Charmcraft | |
run: | | |
sudo snap install charmcraft --channel 3.x/stable --classic | |
- name: Build bundle | |
run: | | |
charmcraft pack | |
- name: Create bundle revision | |
run: | | |
charmcraft upload vantage-agents.zip | |
REVISION=$(charmcraft revisions vantage-agent | head -n 2 | awk '{print $1}' | tail -n 1) | |
echo "REVISION=$REVISION" >> $GITHUB_ENV | |
env: | |
CHARMCRAFT_AUTH: ${{ secrets.CHARMCRAFT_AUTH }} | |
- name: Release bundle | |
run: | | |
charmcraft release vantage-agents -r $REVISION -c ${{ github.event.inputs.channel }} | |
env: | |
CHARMCRAFT_AUTH: ${{ secrets.CHARMCRAFT_AUTH }} |