diff --git a/.github/workflows/trigger-release-binaries-latest-tag.yml b/.github/workflows/trigger-release-binaries-latest-tag.yml new file mode 100644 index 0000000..da33f47 --- /dev/null +++ b/.github/workflows/trigger-release-binaries-latest-tag.yml @@ -0,0 +1,51 @@ +name: Trigger Release Binaries + +on: + push: + branches: + - trigger-release-binaries-latest-tag + +permissions: + actions: write + contents: read + +jobs: + trigger: + runs-on: ubuntu-24.04 + steps: + - name: Checkout tags + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + fetch-depth: 0 + + - name: Resolve latest tag + id: tag + shell: bash + run: | + set -euo pipefail + + git fetch --tags --force + TAG="$( + git tag --list 'v*' --sort=-v:refname \ + | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9.+-]+)?$' \ + | head -n 1 + )" + + if [[ -z "${TAG}" ]]; then + echo "::error::No SemVer-style v* tag found" + exit 1 + fi + + echo "tag=${TAG}" >> "$GITHUB_OUTPUT" + echo "Resolved release tag: ${TAG}" + + - name: Trigger release-binaries.yaml + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + TAG: ${{ steps.tag.outputs.tag }} + shell: bash + run: | + set -euo pipefail + + gh workflow run release-binaries.yaml --ref main --field tag="${TAG}"