diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a4ced23..4159d9c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,27 +16,16 @@ jobs: exit 1 fi - ci: - needs: check-branches - name: Continuous Integration - uses: ./.github/workflows/__shared-ci.yml - permissions: - actions: write - contents: read - id-token: write - issues: read - packages: write - pull-requests: read - secrets: inherit - update_release_draft: name: Draft a new release # we want to publish a new tag only if ci succeeds - needs: ci + needs: check-branches permissions: contents: write pull-requests: write runs-on: self-hosted + outputs: + latestRelease: ${{ steps.update_release_draft.outputs.tag_name }} steps: # create a new release - id: update_release_draft @@ -47,18 +36,24 @@ jobs: publish: true disable-autolabeler: true - - id: get_latest_release - run: | - LATEST_RELEASE=$(curl --silent "https://api.github.com/repos/${{ github.repository }}/releases/latest" \ - -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ - | jq -r .tag_name) - echo "LATEST_RELEASE=$LATEST_RELEASE" >> $GITHUB_ENV - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ci: + needs: update_release_draft + name: Continuous Integration + uses: ./.github/workflows/__shared-ci.yml + with: + tag: ${{ needs.update_release_draft.outputs.latestRelease }} + permissions: + actions: write + contents: read + id-token: write + issues: read + packages: write + pull-requests: read + secrets: inherit helm-push: name: "Helm: push chart to OCI registry" - needs: update_release_draft + needs: [update_release_draft, ci] runs-on: self-hosted steps: # Get a local copy of the code @@ -90,8 +85,8 @@ jobs: chart-folder: helm/chart force: true update-dependencies: true - version: ${{ env.LATEST_RELEASE }} - appVersion: ${{ env.LATEST_RELEASE }} + version: ${{ needs.update_release_draft.outputs.latestRelease }} + appVersion: ${{ needs.update_release_draft.outputs.latestRelease }} env: OCI_REGISTRY: ${{ vars.OCI_REGISTRY }} OCI_REGISTRY_USERNAME: ${{ vars.OCI_REGISTRY_USERNAME }}