feat: use PAT push tag #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Carbide Release new version | |
| on: | |
| push: | |
| tags: | |
| - 'v[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+' | |
| jobs: | |
| # ============================================================================ | |
| # Fetch new version | |
| # ============================================================================ | |
| fetch-new-version: | |
| runs-on: linux-amd64-cpu4 | |
| outputs: | |
| version: ${{ steps.fetch.outputs.version }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Fetch version | |
| id: fetch | |
| run: | | |
| set -euo pipefail | |
| # Extract full tag (e.g. v0.0.1-rc.1) | |
| FULL_TAG=${GITHUB_REF#refs/tags/} | |
| # Extract base version (e.g. v0.0.1) by removing everything after the last -rc pattern | |
| # Or more simply, just regex match the vX.Y.Z part | |
| VERSION=$(echo "$FULL_TAG" | grep -oE '^v[0-9]+\.[0-9]+\.[0-9]+') | |
| echo "Full Tag: $FULL_TAG" | |
| echo "Release Version: $VERSION" | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| # ============================================================================ | |
| # Release new version | |
| # ============================================================================ | |
| release-new-version-approve: | |
| runs-on: linux-amd64-cpu4 | |
| environment: | |
| name: release-new-version-approve | |
| needs: | |
| - fetch-new-version | |
| steps: | |
| - name: Release new version | |
| run: echo "Releasing new version ${{ needs.fetch-new-version.outputs.version }} to NVIDIA Catalog" | |
| # ============================================================================ | |
| # Release new version | |
| # ============================================================================ | |
| release-new-version: | |
| runs-on: linux-amd64-cpu4 | |
| needs: | |
| - fetch-new-version | |
| - release-new-version-approve | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Push Git Tag | |
| uses: NVIDIA/dsx-github-actions/.github/actions/git-tag@260d3f3e8f7c193a87f03d10646ca606165f916e | |
| with: | |
| tag: ${{ needs.fetch-new-version.outputs.version }} | |
| - name: Release | |
| uses: softprops/action-gh-release@v2 | |
| if: github.ref_type == 'tag' | |
| with: | |
| name: ${{ needs.fetch-new-version.outputs.version }} | |
| tag_name: ${{ needs.fetch-new-version.outputs.version }} |