Skip to content

Commit

Permalink
rollback legacy file and move to new one
Browse files Browse the repository at this point in the history
  • Loading branch information
simskij committed Dec 1, 2023
1 parent 9785f8e commit df957df
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 32 deletions.
29 changes: 26 additions & 3 deletions .github/workflows/_charm-release.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 charms
runs-on: ubuntu-22.04
steps:
- name: Checkout
Expand All @@ -37,16 +37,39 @@ jobs:
- name: Unpack Artifact
run: sudo apt-get update && sudo apt-get install tar && tar xf artifact.tar.gz
if: ${{ inputs.artifact != '' }}
- name: Build charm(s)
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 charms
uses: actions/upload-artifacts@v3
with:
name: charms
path: *.charm

release-to-charmhub:
name: Release to CharmHub
runs-on: ubuntu-22.04
needs:
- build
strategy:
matrix:
path: ${{ fromjson(needs.build.outputs.charms) }}
steps:
- name: Select charmhub channel
uses: canonical/charming-actions/[email protected]
id: channel
- name: Fetch charm artifacts
uses: actions/download-artifact@v3
with:
name: charms
- name: Upload charm to charmhub
uses: canonical/charming-actions/[email protected]
with:
credentials: "${{ secrets.CHARMHUB_TOKEN }}"
github-token: "${{ secrets.GITHUB_TOKEN }}"
channel: "${{ steps.channel.outputs.name }}"
charm-path: "${{ inputs.charm-path }}"
built-charm-path: "${{ matrix.path }}"
# We set destructive mode to false, otherwise runner's OS would have to match
# charm's 'build-on' OS.
destructive-mode: false
33 changes: 4 additions & 29 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:
build:
name: Build the artifacts
release-to-charmhub:
name: Release to CharmHub
runs-on: ubuntu-20.04
steps:
- name: Checkout
Expand All @@ -36,35 +36,10 @@ jobs:
- name: Select charmhub channel
uses: canonical/charming-actions/[email protected]
id: channel
- name: Build charm(s)
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:
matrix:
path: ${{ fromjson(outputs.charms) }}
with:
credentials: "${{ secrets.CHARMHUB_TOKEN }}"
github-token: "${{ secrets.GITHUB_TOKEN }}"
channel: "${{ needs.build.outputs.name }}"
built-charm-path: "${{ matrix.path }}"
channel: "${{ steps.channel.outputs.name }}"
charm-path: "${{ inputs.charm-path }}"

0 comments on commit df957df

Please sign in to comment.