Skip to content

Commit

Permalink
Update release workflow for 5/edge:
Browse files Browse the repository at this point in the history
use data platform workflows
  • Loading branch information
dmitry-ratushnyy committed Nov 24, 2023
1 parent 7e659d0 commit 0fa98e4
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 18 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release to 5/edge

on:
push:
branches:
- main

jobs:
lib-check:
name: Check libraries
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check libs
uses: canonical/charming-actions/[email protected]
with:
# FIXME: CHARMHUB_TOKEN will expire in 2024-01-20
# NOTE: CHARMHUB_TOKEN is only allowed in latest/edge, latest/candidate
credentials: "${{ secrets.CHARMHUB_TOKEN }}"
github-token: "${{ secrets.GITHUB_TOKEN }}"

ci-tests:
needs:
- lib-check
uses: ./.github/workflows/ci.yaml

build:
name: Build charm
uses: canonical/data-platform-workflows/.github/workflows/build_charm_without_cache.yaml@v5
with:
charmcraft-snap-channel: "latest/edge"

release:
name: Release charm
needs:
- ci-tests
- build
uses: canonical/data-platform-workflows/.github/workflows/release_charm.yaml@v5
with:
channel: 5/edge
artifact-name: ${{ needs.build.outputs.artifact-name }}
secrets:
charmhub-token: ${{ secrets.CHARMHUB_TOKEN }}
permissions:
contents: write # Needed to create GitHub release
37 changes: 19 additions & 18 deletions .github/workflows/release_5_edge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,22 @@ jobs:
- lib-check
uses: ./.github/workflows/ci.yaml

release-to-charmhub:
name: Release to CharmHub
needs:
- lib-check
- ci-tests
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Upload charm to charmhub
uses: canonical/charming-actions/[email protected]
with:
credentials: "${{ secrets.CHARMHUB_TOKEN }}"
github-token: "${{ secrets.GITHUB_TOKEN }}"
channel: "5/edge"
build:
name: Build charm
uses: canonical/data-platform-workflows/.github/workflows/build_charm_without_cache.yaml@v5
with:
charmcraft-snap-channel: "latest/edge"

release:
name: Release charm
needs:
- ci-tests
- build
uses: canonical/data-platform-workflows/.github/workflows/release_charm.yaml@v5
with:
channel: 5/edge
artifact-name: ${{ needs.build.outputs.artifact-name }}
secrets:
charmhub-token: ${{ secrets.CHARMHUB_TOKEN }}
permissions:
contents: write # Needed to create GitHub release

0 comments on commit 0fa98e4

Please sign in to comment.