Skip to content

Commit

Permalink
Update workflows to release only tested charms
Browse files Browse the repository at this point in the history
  • Loading branch information
chanchiwai-ray committed Mar 4, 2025
1 parent c6cbbe8 commit d3834a2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,15 @@ jobs:
env:
TEST_JUJU_CHANNEL: ${{ matrix.juju-channel }}

- name: Determine system architecture
run: echo "SYSTEM_ARCH=$(uname -m)" >> $GITHUB_ENV

- name: Upload the tested charms
uses: actions/upload-artifact@v4
with:
name: charm_${{ env.SYSTEM_ARCH }}
path: ./*.charm

# Save output for debugging

- name: Generate debugging information
Expand Down
27 changes: 14 additions & 13 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,27 @@ jobs:

release:
needs: check
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
runs-on: [[ubuntu-22.04]]
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Initialize lxd # This should dropped once it's implemented on charming-actions itself. https://github.com/canonical/charming-actions/issues/140
# revision is latest main at time of writing; using because it contains a fix to https://github.com/canonical/setup-lxd/issues/19
uses: canonical/setup-lxd@2aa6f7caf7d1484298a64192f7f63a6684e648a4
- name: Download the tested charms
uses: actions/download-artifact@v4
with:
pattern: charm_*
merge-multiple: true

- name: List the names of the tested charms
run: |
echo "CHARM_NAMES=$(ls *.charm | paste -sd ,)" >> "$GITHUB_ENV"
echo "${{ env.CHARM_NAMES }}"
- name: Pack and upload to charmhub
uses: canonical/charming-actions/upload-charm@2.6.2
- name: Upload the tested charms to charmhub
uses: canonical/charming-actions/upload-charm@2.7.0
with:
charmcraft-channel: "3.x/stable"
credentials: "${{ secrets.CHARMHUB_TOKEN }}"
github-token: "${{ secrets.GITHUB_TOKEN }}"
# Ensure the charm is built in an isolated environment and on the correct base in an lxd container.
destructive-mode: false
built-charm-path: "${{ env.CHARM_NAMES }}"

0 comments on commit d3834a2

Please sign in to comment.