diff --git a/.github/workflows/frontend_charm_promote.yml b/.github/workflows/frontend_charm_promote.yml new file mode 100644 index 00000000..617a6cd2 --- /dev/null +++ b/.github/workflows/frontend_charm_promote.yml @@ -0,0 +1,43 @@ +name: Promote Charm + +on: + workflow_dispatch: + inputs: + promotion: + type: choice + description: Channel to promote from + options: + - edge -> beta + - beta -> candidate + - candidate -> stable + +jobs: + promote: + name: Promote Charm + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set target channel + env: + PROMOTE_FROM: ${{ github.event.inputs.promotion }} + run: | + if [ "${PROMOTE_FROM}" == "edge -> beta" ]; then + echo "promote-from=edge" >> ${GITHUB_ENV} + echo "promote-to=beta" >> ${GITHUB_ENV} + elif [ "${PROMOTE_FROM}" == "beta -> candidate" ]; then + echo "promote-from=beta" >> ${GITHUB_ENV} + echo "promote-to=candidate" >> ${GITHUB_ENV} + elif [ "${PROMOTE_FROM}" == "candidate -> stable" ]; then + echo "promote-from=candidate" >> ${GITHUB_ENV} + echo "promote-to=stable" >> ${GITHUB_ENV} + fi + - name: Promote Charm + uses: canonical/charming-actions/release-charm@2.2.0 + with: + base-channel: 22.04 + credentials: ${{ secrets.CHARMHUB_TOKEN }} + github-token: ${{ secrets.GITHUB_TOKEN }} + destination-channel: latest/${{ env.promote-to }} + origin-channel: latest/${{ env.promote-from }} + charmcraft-channel: latest/stable