From fd4a0430a831c3c67d7f7b57b123bf191be27c35 Mon Sep 17 00:00:00 2001 From: Benoit Ranque Date: Tue, 15 Oct 2024 11:39:06 -0400 Subject: [PATCH] CI: explicitly trigger release workflow after tagging --- .github/workflows/deploy-stage.yaml | 1 + .github/workflows/tag-release.yaml | 16 +++++++--------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/deploy-stage.yaml b/.github/workflows/deploy-stage.yaml index f3b6c5e..d546b53 100644 --- a/.github/workflows/deploy-stage.yaml +++ b/.github/workflows/deploy-stage.yaml @@ -8,6 +8,7 @@ on: - main tags: - 'v*' + workflow_dispatch: # Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds. env: diff --git a/.github/workflows/tag-release.yaml b/.github/workflows/tag-release.yaml index 526b5c7..a956d55 100644 --- a/.github/workflows/tag-release.yaml +++ b/.github/workflows/tag-release.yaml @@ -21,15 +21,13 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 - - name: Read version from Cargo.toml + - name: Read version from Cargo.toml and push appropriate tag id: read-version run: | CARGO_VERSION="$(cargo metadata --format-version=1 | jq -r '.packages | .[] | select(.name == "ndc-clickhouse-cli") | .version')" - echo "RELEASE_VERSION=$CARGO_VERSION" >> "$GITHUB_OUTPUT" - - - name: Push Tag - uses: anothrNick/github-tag-action@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - RELEASE_BRANCHES: release-.* - CUSTOM_TAG: v${{ steps.read-version.outputs.RELEASE_VERSION }} \ No newline at end of file + VERSION_TAG="v$CARGO_VERSION" + echo "Tagging $VERSION_TAG" + git tag $VERSION_TAG + git push --tags + # Explicitly run our release workflow for this new tag + gh workflow run deploy-stage.yml --ref $VERSION_TAG \ No newline at end of file