chore: update code to use new paas-charm library (#2019) #9
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
name: Pack and Publish Charm | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'charm/**' # Only trigger when changes are made to the ./charm/ directory | |
pull_request: | |
paths: | |
- 'charm/**' | |
jobs: | |
pack-charm: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup LXD | |
uses: canonical/setup-lxd@main | |
- name: Setup charmcraft | |
run: sudo snap install charmcraft --classic --channel=latest/edge | |
- name: Fetch libs | |
run: | | |
cd ./charm | |
charmcraft fetch-libs | |
- name: Pack charm | |
run: charmcraft pack -v --project-dir ./charm | |
- name: Upload charm (only runs on push to main) | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
env: | |
CHARMCRAFT_AUTH: ${{ secrets.CHARMHUB_TOKEN }} | |
run: charmcraft upload ./*.charm |