From 7c6f00db88dea8d3b8d1e0d638f4c066e68f4c18 Mon Sep 17 00:00:00 2001 From: Jon Seager Date: Fri, 21 Oct 2022 11:57:15 +0100 Subject: [PATCH] ci: update charming-actions Talking to @taurus-forever about the recently merged change, I noticed that we didn't bump the actual upload action, and also that we weren't actually using the `charming-actions/channel` action. --- .github/workflows/ci.yaml | 50 ++++++++++++++++++++-------------- .github/workflows/release.yaml | 10 +++---- 2 files changed, 33 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 643225393..97c75417d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -2,6 +2,9 @@ name: Tests on: pull_request: workflow_call: + secrets: + CHARMHUB_TOKEN: + required: true jobs: lint: @@ -9,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install dependencies run: python3 -m pip install tox - name: Run linters @@ -20,21 +23,36 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install dependencies run: python -m pip install tox - name: Run tests run: tox -e unit + 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: + credentials: "${{ secrets.CHARMHUB_TOKEN }}" # FIXME: current token will expire in 2023-07-04 + github-token: "${{ secrets.GITHUB_TOKEN }}" + charm-integration-test-lxd: name: Charm integration tests (lxd) needs: - lint - unit-test + - lib-check runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup operator environment uses: charmed-kubernetes/actions-operator@main with: @@ -47,10 +65,11 @@ jobs: needs: - lint - unit-test + - lib-check runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup operator environment uses: charmed-kubernetes/actions-operator@main with: @@ -63,10 +82,11 @@ jobs: needs: - lint - unit-test + - lib-check runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup operator environment uses: charmed-kubernetes/actions-operator@main with: @@ -79,10 +99,11 @@ jobs: needs: - lint - unit-test + - lib-check runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup operator environment uses: charmed-kubernetes/actions-operator@main with: @@ -95,27 +116,14 @@ jobs: needs: - lint - unit-test + - lib-check runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup operator environment uses: charmed-kubernetes/actions-operator@main with: provider: lxd - name: Run tls integration tests run: tox -e tls-integration - - lib-check: - name: Check libraries - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Check libs - uses: canonical/charming-actions/check-libraries@1.0.3 - with: - credentials: "${{ secrets.CHARMHUB_TOKEN }}" # FIXME: current token will expire in 2023-07-04 - github-token: "${{ secrets.GITHUB_TOKEN }}" \ No newline at end of file diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 632357693..8a2ba64c9 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -8,23 +8,21 @@ on: jobs: ci-tests: uses: ./.github/workflows/ci.yaml + secrets: + CHARMHUB_TOKEN: "${{ secrets.CHARMHUB_TOKEN }}" release-to-charmhub: name: Release to CharmHub needs: - - lib-check - ci-tests runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Select charmhub channel - uses: canonical/charming-actions/upload-charm@2.1.0-rc - id: channel - name: Upload charm to charmhub - uses: canonical/charming-actions/upload-charm@2.0.0-rc + uses: canonical/charming-actions/upload-charm@2.1.1 with: credentials: "${{ secrets.CHARMHUB_TOKEN }}" github-token: "${{ secrets.GITHUB_TOKEN }}"