ci: Publish bundle to charmhub #16
Workflow file for this run
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: Publish bundle to charmhub | |
on: | |
push: | |
branches: | |
- main | |
- track/** | |
paths: | |
- releases/** | |
# only for testing purposes | |
pull_request: | |
paths: | |
- releases/** | |
jobs: | |
get-releases-affected: | |
name: Get releases affected | |
runs-on: ubuntu-22.04 | |
outputs: | |
releases_affected: ${{ steps.get-releases-affected.outputs.releases_affected_json }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Get files changed | |
id: changed-files | |
uses: tj-actions/changed-files@v37 | |
- name: Get releases affected | |
id: get-releases-affected | |
run: python scripts/get_releases_affected.py ${{ steps.changed-files.outputs.all_changed_files }} | |
# No action for running tests is available at the moment | |
# run-tests-for-releases-affected: | |
# needs: get-releases-affected | |
publish-bundle-for-releases-affected: | |
name: Publish bundle for releases affected to corresponding Charmhub channels | |
runs-on: ubuntu-22.04 | |
needs: [get-releases-affected] | |
# needs: [get-releases-affected, run-tests-for-releases-affected] | |
strategy: | |
fail-fast: false | |
matrix: | |
release: ${{ fromJson(needs.get-releases-affected.outputs.releases_affected) }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Get bundle path for current release | |
id: bundle-path | |
run: python scripts/get_bundle_path.py ${{ matrix.release }} | |
- name: Publish bundle for release ${{ matrix.release }} to Charmhub | |
run: | | |
echo release is ${{ matrix.release }} | |
echo bundle path is ${{ steps.bundle-path.outputs.bundle_path }} | |
# uses: canonical/charming-actions/[email protected] | |
# with: | |
# credentials: ${{ secrets.CHARMCRAFT_CREDENTIALS }} | |
# github-token: ${{ secrets.GITHUB_TOKEN }} | |
# bundle-path: ${{ steps.bundle-path. }} | |
# channel: ${{ matrix.release }} |