Skip to content

feat: use PAT push tag #2

feat: use PAT push tag

feat: use PAT push tag #2

Workflow file for this run

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 }}