Skip to content

chore: update charm libraries (#218) #131

chore: update charm libraries (#218)

chore: update charm libraries (#218) #131

name: Publish Charms to 1.xx/edge
on:
workflow_dispatch:
push:
branches:
- main
- release-*
jobs:
configure-channel:
runs-on: ubuntu-latest
outputs:
track: ${{ steps.channel.outputs.track }}
risk: ${{ steps.channel.outputs.risk }}
steps:
- name: Determine Channel
id: channel
env:
BRANCH: ${{ github.base_ref || github.ref }}
run: |
BRANCH=${BRANCH#refs/heads/} # strip off refs/heads/ if it exists
if [[ "${BRANCH}" == "main" ]]; then
echo "track=latest" >> "$GITHUB_OUTPUT"
echo "risk=edge" >> "$GITHUB_OUTPUT"
elif [[ "${BRANCH}" =~ ^release-[0-9]+\.[0-9]+$ ]]; then
echo "track=${BRANCH:8}" >> "$GITHUB_OUTPUT"
echo "risk=beta" >> "$GITHUB_OUTPUT"
else
echo "::error Failed to determine track/risk from branch ${BRANCH}"
exit 1
fi
charmcraft-channel:
runs-on: ubuntu-latest
outputs:
channel: ${{ steps.charmcraft.outputs.channel }}
steps:
- uses: actions/checkout@v4
- name: Read charmcraft version file
id: charmcraft
run: echo "channel=$(cat .charmcraft-channel)" >> $GITHUB_OUTPUT
publish-to-edge:
needs: [configure-channel, charmcraft-channel]
uses: canonical/operator-workflows/.github/workflows/publish_charm.yaml@main
strategy:
matrix:
charm:
- { path: ./charms/worker/k8s/, tagPrefix: k8s }
- { path: ./charms/worker/, tagPrefix: k8s-worker }
arch:
- amd64
- arm64
secrets: inherit
with:
channel: ${{needs.configure-channel.outputs.track}}/${{needs.configure-channel.outputs.risk}}
working-directory: ${{ matrix.charm.path }}
charmcraft-channel: ${{ needs.charmcraft-channel.outputs.channel }}
tag-prefix: ${{ matrix.charm.tagPrefix }}
identifier: ${{matrix.arch}}-k8s