Skip to content

Commit 591aef3

Browse files
Update nbgv_prepare_release.yml
1 parent ef5fca3 commit 591aef3

1 file changed

Lines changed: 12 additions & 26 deletions

File tree

.github/workflows/nbgv_prepare_release.yml

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,18 @@ on:
44
workflow_call:
55
inputs:
66
target_branch:
7+
description: "Branch or tag to release from"
78
type: string
89
required: true
910
default: main
1011
increment:
12+
description: "Version increment (major | minor | patch)"
1113
type: string
1214
required: true
1315
default: patch
1416
secrets:
1517
GH_TOKEN:
18+
description: "GitHub token (falls back to github.token if not provided)"
1619
required: false
1720

1821
jobs:
@@ -26,34 +29,17 @@ jobs:
2629
fetch-depth: 0
2730
token: ${{ secrets.GH_TOKEN || github.token }}
2831

29-
- name: ⚙️ Setup .NET & restore NBGV
32+
- name: ⚙️ Setup .NET 9.x
3033
uses: actions/setup-dotnet@v4
3134
with:
32-
dotnet-version: "9.0.x"
33-
- run: dotnet tool restore
35+
dotnet-version: 9.0.x
3436

35-
- name: 🖊️ Inject omitCommitId into version.json
36-
run: |
37-
# Backup and rewrite version.json to include omitCommitId=true
38-
jq '.release +={"omitCommitId": true}' version.json > version.tmp.json
39-
mv version.tmp.json version.json
40-
41-
- name: 🗂️ Prepare release
42-
id: prepare
43-
run: |
44-
git config user.name "release-bot"
45-
git config user.email "release-bot@users.noreply.github.com"
46-
47-
INC=${{ inputs.increment }}
48-
case "$INC" in
49-
major) FLAGS="--versionIncrement major" ;;
50-
minor) FLAGS="--versionIncrement minor" ;;
51-
patch) FLAGS="" ;;
52-
esac
53-
54-
dotnet nbgv prepare-release --project "$GITHUB_WORKSPACE" $FLAGS
55-
56-
echo "release_branch=$(git rev-parse --abbrev-ref HEAD)" >> "$GITHUB_OUTPUT"
37+
- name: 🛠️ Bump version & create branch
38+
id: nbgv
39+
uses: dotnet/nbgv@master
40+
with:
41+
version-increment: ${{ inputs.increment }}
42+
version-file: version.json
5743

5844
outputs:
59-
release_branch: ${{ steps.prepare.outputs.release_branch }}
45+
release_branch: ${{ steps.nbgv.outputs.BranchName }}

0 commit comments

Comments
 (0)