Skip to content

Commit

Permalink
CI: explicitly trigger release workflow after tagging
Browse files Browse the repository at this point in the history
  • Loading branch information
BenoitRanque committed Oct 15, 2024
1 parent 78769a2 commit fd4a043
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy-stage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/tag-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
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

0 comments on commit fd4a043

Please sign in to comment.