Skip to content

Commit

Permalink
Fix/allow for multiple builds on (#129)
Browse files Browse the repository at this point in the history
* fix: allow for multiple builds-on entries

* fix: move matrix to job level
  • Loading branch information
simskij authored Dec 1, 2023
1 parent be083e0 commit 9785f8e
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/_release_charm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/[email protected]
strategy:
Expand All @@ -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 }}"

0 comments on commit 9785f8e

Please sign in to comment.