diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index df5c2c128..06f43f94a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,9 +1,6 @@ name: Charmed Operator Tests on: workflow_call: - push: - branches: - - main pull_request: jobs: @@ -12,4 +9,4 @@ jobs: unit: uses: ./.github/workflows/unit.yaml integration: - uses: ./.github/workflows/integration.yaml \ No newline at end of file + uses: ./.github/workflows/integration.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 000000000..c0fbe14f4 --- /dev/null +++ b/.github/workflows/release.yaml @@ -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/check-libraries@2.1.1 + 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/channel@2.1.1 + id: channel + - name: Upload charm to charmhub + uses: canonical/charming-actions/upload-charm@2.1.1 + with: + credentials: "${{ secrets.CHARMHUB_TOKEN }}" + github-token: "${{ secrets.GITHUB_TOKEN }}" + channel: "${{ steps.channel.outputs.name }}"