-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CI/CD pipeline to publish on charmhub.io (#95)
* Add CI/CD pipeline to publish on charmhub.io * generated and configured new CHARMHUB_TOKEN * Do not call ci.yaml on merge to trunk The release.yaml will run ci.yaml tests after merging and before publishing.
- Loading branch information
1 parent
2f3c832
commit 784c51f
Showing
2 changed files
with
50 additions
and
4 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
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Release to latest/edge | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lib-check: | ||
name: Check libraries | ||
runs-on: ubuntu-latest | ||
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 | ||
|
||
release-to-charmhub: | ||
name: Release to CharmHub | ||
needs: | ||
- lib-check | ||
- ci-tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Select charmhub channel | ||
uses: canonical/charming-actions/[email protected] | ||
id: channel | ||
- 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 }}" |