-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix/allow for multiple builds on (#129)
* fix: allow for multiple builds-on entries * fix: move matrix to job level
- Loading branch information
Showing
1 changed file
with
21 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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/[email protected] | ||
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 }}" |