Skip to content

Commit

Permalink
ci: fix wrong version pushed in OCI repo
Browse files Browse the repository at this point in the history
  • Loading branch information
fredleger committed Mar 19, 2024
1 parent 40cbd01 commit 1f595eb
Showing 1 changed file with 20 additions and 25 deletions.
45 changes: 20 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 }}
Expand Down

0 comments on commit 1f595eb

Please sign in to comment.