Skip to content

Commit

Permalink
CI: add publish_charm workflow (#1909)
Browse files Browse the repository at this point in the history
  • Loading branch information
M7mdisk committed Jul 29, 2024
1 parent 85f67bd commit 673693b
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/publish_charm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build and publish charm
on:
push:
branches:
- charming-charmhub # TODO(mhdisk): Change this to main once we are ready to deploy
env:
CHARMCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS: true
ROCKCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS: true

jobs:
upload-charm:
name: Build and upload charm to charmhub
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup LXD
uses: canonical/setup-lxd@main

- name: Setup Charmcraft
run: |
sudo snap install charmcraft --classic --channel=latest/edge
sudo snap install rustup --classic
- name: Fetch charm libs
run: |
cd ./charm
charmcraft fetch-libs
- name: Pack charm
run: |
mkdir dist
charmcraft pack -v --project-dir ./charm -o dist
- name: Upload charm to charmhub
uses: canonical/charming-actions/[email protected]
with:
charm-path: ./charm/
credentials: ${{ secrets.CHARMHUB_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
charmcraft-channel: latest/edge
built-charm-path: ./dist/

0 comments on commit 673693b

Please sign in to comment.