From 48f5119cbbb88aca5e6d01d0907151b1f40dff51 Mon Sep 17 00:00:00 2001 From: Jordan Barrett Date: Wed, 10 May 2023 13:09:27 +1000 Subject: [PATCH 1/3] [ci] Add workflow to release to edge --- .github/workflows/ci.yml | 44 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e608ac..1e85efd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -93,3 +93,47 @@ jobs: juju status # TODO: test integration with dashboard / ha-proxy + + release: + name: "Release to edge" + runs-on: ubuntu-latest + needs: [build, bootstrap] + if: github.event_name == 'push' + + steps: + - name: Download packed charm + id: download + uses: actions/download-artifact@v3 + with: + name: ${{ needs.build.outputs.artifact-name }} + + - name: Select Charmhub channel + id: channel + shell: bash + run: | + set -x + case ${{ github.ref_name }} in + 3.* | 4.*) + TRACK="${{ github.ref_name }}" + ;; + master) + TRACK="latest" + ;; + esac + echo "track=$TRACK" >> "$GITHUB_OUTPUT" + + if [[ -z $CHANNEL ]]; then + echo "upload=false" >> "$GITHUB_OUTPUT" + else + echo "upload=true" >> "$GITHUB_OUTPUT" + fi + + + - name: Upload to Charmhub + if: steps.channel.outputs.upload == 'true' + env: + CHARMCRAFT_AUTH: ${{ secrets.CHARMCRAFT_AUTH }} + run: | + sudo snap install charmcraft --classic + charmcraft upload ${{ steps.download.outputs.download-path }}/*.charm \ + --release ${{ steps.channel.outputs.track }}/edge From 5818ef5318d6cff782103cf8cff2095e7c1a0304 Mon Sep 17 00:00:00 2001 From: Jordan Barrett Date: Wed, 10 May 2023 14:09:59 +1000 Subject: [PATCH 2/3] [ci/release] change $CHANNEL to $TRACK --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e85efd..7a0cad0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -122,7 +122,7 @@ jobs: esac echo "track=$TRACK" >> "$GITHUB_OUTPUT" - if [[ -z $CHANNEL ]]; then + if [[ -z $TRACK ]]; then echo "upload=false" >> "$GITHUB_OUTPUT" else echo "upload=true" >> "$GITHUB_OUTPUT" From 45ffc149f0445e4617dff30fe77c8fd7612e5fd2 Mon Sep 17 00:00:00 2001 From: Carl Csaposs Date: Fri, 28 Jul 2023 19:44:48 +0000 Subject: [PATCH 3/3] Update build_charms_with_cache.yaml to v4 None of the breaking changes from v2 to v4 affect the usage in this repository --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7a0cad0..907b376 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: build: name: Build charms - uses: canonical/data-platform-workflows/.github/workflows/build_charms_with_cache.yaml@v2 + uses: canonical/data-platform-workflows/.github/workflows/build_charms_with_cache.yaml@v4 with: artifact-name: charm-packed