-
Notifications
You must be signed in to change notification settings - Fork 150
102 lines (92 loc) · 3.71 KB
/
Copy pathrelease.yaml
File metadata and controls
102 lines (92 loc) · 3.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: Carbide Release new version
on:
workflow_dispatch:
jobs:
# ============================================================================
# Release new version
# ============================================================================
release-new-version-approve:
runs-on: linux-amd64-cpu4
environment:
name: release-new-version-approve
steps:
- name: Release new version
run: echo "Releasing new version to NVIDIA Catalog"
# ============================================================================
# Fetch new version
# ============================================================================
fetch-new-version:
runs-on: linux-amd64-cpu4
needs:
- release-new-version-approve
outputs:
version: ${{ steps.fetch.outputs.version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
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:
runs-on: linux-amd64-cpu4
needs:
- fetch-new-version
steps:
# persist-credentials is intentionally left enabled here: the "Push Git Tag"
# step below pushes back to the repo using the credential this checkout persists.
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Push Git Tag
uses: NVIDIA/dsx-github-actions/.github/actions/git-tag@95e609360851cfc141918c2c21e57762d77394ac
with:
tag: ${{ needs.fetch-new-version.outputs.version }}
- name: Release
uses: softprops/action-gh-release@v2
if: false
with:
name: ${{ needs.fetch-new-version.outputs.version }}
tag_name: ${{ needs.fetch-new-version.outputs.version }}
- name: Release new version
if: false
run: |
VERSION="${{ needs.fetch-new-version.outputs.version }}"
REPO="${{ github.repository }}"
RELEASE_URL="https://github.com/$REPO/releases/tag/$VERSION"
echo "Releasing new version $VERSION to NVIDIA Catalog"
echo "## 🚀 Release Created" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "Release carbide version: **$VERSION**" >> "$GITHUB_STEP_SUMMARY"
echo "🔗 [View Release Notes]($RELEASE_URL)" >> "$GITHUB_STEP_SUMMARY"