From 9785f8e6dfceeed1f688d463dea0faff1af5ef78 Mon Sep 17 00:00:00 2001 From: Simon Aronsson Date: Fri, 1 Dec 2023 16:34:41 +0100 Subject: [PATCH] Fix/allow for multiple builds on (#129) * fix: allow for multiple builds-on entries * fix: move matrix to job level --- .github/workflows/_release_charm.yaml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/_release_charm.yaml b/.github/workflows/_release_charm.yaml index faa6cf1e..a51e56d4 100644 --- a/.github/workflows/_release_charm.yaml +++ b/.github/workflows/_release_charm.yaml @@ -16,8 +16,8 @@ on: required: true jobs: - release-to-charmhub: - name: Release to CharmHub + build: + name: Build the artifacts runs-on: ubuntu-20.04 steps: - name: Checkout @@ -40,6 +40,24 @@ jobs: run: | charmcraft pack --project-dir ${{ inputs.charm_path }} CHARMS=$(ls ./*.charm | jq -R -s -c 'split("\n")[:-1]') echo "charms=$CHARMS" >> "$GITHUB_OUTPUT" + - name: Store artifacts + uses: actions/upload-artifact@v3 + with: + name: charms + path: *.charm + + release-to-charmhub: + name: Release to CharmHub + runs-on: ubuntu-20.04 + strategy: + matrix: + path: ${{ fromjson(needs.build.outputs.charms) }} + needs: + - build + steps: + - name: Download charm artifact + with: + name: charms - name: Upload charm to charmhub uses: canonical/charming-actions/upload-charm@2.1.1 strategy: @@ -48,5 +66,5 @@ jobs: with: credentials: "${{ secrets.CHARMHUB_TOKEN }}" github-token: "${{ secrets.GITHUB_TOKEN }}" - channel: "${{ steps.channel.outputs.name }}" + channel: "${{ needs.build.outputs.name }}" built-charm-path: "${{ matrix.path }}"