forked from NVIDIA-NeMo/Megatron-Bridge
-
Notifications
You must be signed in to change notification settings - Fork 0
119 lines (105 loc) · 3.84 KB
/
Copy pathrelease-freeze.yml
File metadata and controls
119 lines (105 loc) · 3.84 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
#
# 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: "Code freeze"
on:
workflow_dispatch:
inputs:
release-type:
type: choice
description: Type of release
options:
- major
- minor
freeze-commit:
type: string
description: Commit SHA to use for cut-off
required: false
default: main
dry-run:
type: boolean
description: Dry-run of code-freeze
required: false
default: true
jobs:
code-freeze:
uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/_code_freeze.yml@v0.86.0
with:
library-name: Megatron-Bridge
python-package: megatron.bridge
has-src-dir: true
release-type: ${{ inputs.release-type }}
freeze-commit: ${{ inputs.freeze-commit }}
dry-run: ${{ inputs.dry-run }}
use-pat: true
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_MAIN_CHANNEL_WEBHOOK }}
SLACK_WEBHOOK_ADMIN: ${{ secrets.SLACK_TEAM_GROUP_ID }}
PAT: ${{ secrets.PAT }}
bump-docs-versions:
needs: [code-freeze]
runs-on: ubuntu-latest
env:
VERSION: ${{ needs.code-freeze.outputs.release-branch }}
DRY_RUN: ${{ inputs.dry-run }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
ref: main
token: ${{ secrets.PAT }}
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Update versions1.json
run: |
version_number=$(echo ${VERSION} | sed 's/^r//')
jq --arg ver "$version_number" \
'. += [{"version": $ver, "url": "https://docs.nvidia.com/nemo/megatron-bridge/\($ver)/"}] | sort_by(.version) | reverse' \
docs/versions1.json > tmp.json && mv tmp.json docs/versions1.json
- name: Commit changes
id: commit-versions1
run: |
git add docs/versions1.json
git commit -m "[🤖]: Update docs-versions after code-freeze for ${VERSION}"
commit_hash=$(git rev-parse HEAD)
echo "commit_hash=${commit_hash}" | tee -a $GITHUB_OUTPUT
if [[ "$DRY_RUN" != "true" ]]; then
git push
fi
- name: Switch to release branch
run: |
git fetch origin ${{ needs.code-freeze.outputs.release-branch }}
git checkout ${{ needs.code-freeze.outputs.release-branch }}
- name: Cherry-pick docs-versions commit
run: |
git cherry-pick ${{ steps.commit-versions1.outputs.commit_hash }}
- name: Update project.json
run: |
version_number=$(echo ${VERSION} | sed 's/^r//')
jq --arg ver "$version_number" \
'. = {"version": $ver, "name": "megatron-bridge"}' \
docs/project.json > tmp.json && mv tmp.json docs/project.json
- name: Update conf.py
run: |
version_number=$(echo ${VERSION} | sed 's/^r//')
sed -i "s/release = .*/release = \"${version_number}\"/" docs/conf.py
- name: Commit changes
run: |
git add docs/project.json
git add docs/conf.py
git commit -m "Bump docs version to ${VERSION}"
if [[ "$DRY_RUN" != "true" ]]; then
git push
fi