Skip to content

Commit 32c8cb6

Browse files
authored
Update workflows (#3271)
1 parent 6d8152e commit 32c8cb6

7 files changed

Lines changed: 43 additions & 35 deletions

File tree

‎.github/actions/setup-additional-tools/action.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ runs:
99
using: composite
1010
steps:
1111
- name: Set up node
12-
uses: actions/setup-node@v6
12+
uses: actions/setup-node@v7
1313
with:
1414
node-version: "22" # Temporary workaround for https://github.com/dotnet/BenchmarkDotNet/issues/3154
1515

‎.github/workflows/generate-changelog.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3232

3333
- name: Push changelog
34-
uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0
34+
uses: JamesIves/github-pages-deploy-action@fa24774553152dd7873cd16ebd8d959b010c5445 # v4.9.0
3535
with:
3636
branch: docs-changelog
3737
folder: docs/_changelog

‎.github/workflows/generate-gh-pages.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
steps:
5050

5151
- name: Checkout
52-
uses: actions/checkout@v6
52+
uses: actions/checkout@v7
5353
with:
5454
ref: docs-stable
5555

@@ -63,7 +63,7 @@ jobs:
6363
run: tree $GITHUB_WORKSPACE
6464

6565
- name: Deploy documentation
66-
uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0
66+
uses: JamesIves/github-pages-deploy-action@fa24774553152dd7873cd16ebd8d959b010c5445 # v4.9.0
6767
with:
6868
branch: gh-pages
6969
folder: site
Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,28 @@
11
name: publish-preview
2-
run-name: Publish preview nupkg 0.16.0-${{ inputs.suffix }}
2+
run-name: Publish preview ${{ inputs.suffix }}
33

44
on:
55
workflow_dispatch:
66
inputs:
77
suffix:
88
description: 'Prerelease suffix (produces <VersionPrefix>-<suffix>, e.g. preview.1)'
99
required: true
10-
default: 'preview.1'
11-
12-
env:
13-
DOTNET_VERSION: "8.0.410"
1410

1511
jobs:
1612
publish:
1713
runs-on: ubuntu-latest
1814
environment: deploy # Only maintainers can execute this workflow (gates the NuGet.org push)
1915
if: ${{ github.repository == 'dotnet/BenchmarkDotNet' }}
16+
permissions:
17+
contents: write
18+
discussions: write
2019
steps:
2120
- name: Checkout sources
2221
uses: actions/checkout@v7
2322

24-
- name: Setup .NET Core
25-
uses: actions/setup-dotnet@v5
26-
with:
27-
dotnet-version: ${{ env.DOTNET_VERSION }}
23+
- name: Read current version
24+
id: version
25+
run: echo "VERSION=$(grep -v '^$' build/versions.txt | tail -n 1)-${{ inputs.suffix }}" >> $GITHUB_OUTPUT
2826

2927
- name: Pack
3028
run: ./build.cmd pack /p:VersionSuffix=${{ inputs.suffix }} /p:WeaverVersionSuffix=\"\"
@@ -36,4 +34,20 @@ jobs:
3634
path: artifacts/*.nupkg
3735

3836
- name: Publish to NuGet
39-
run: dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
37+
run: ./.dotnet/dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
38+
39+
- name: Tag release
40+
run: |
41+
git tag v${{ steps.version.outputs.VERSION }}
42+
git push origin v${{ steps.version.outputs.VERSION }}
43+
44+
- name: Release
45+
uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
46+
with:
47+
name: v${{ steps.version.outputs.VERSION }}
48+
tag_name: v${{ steps.version.outputs.VERSION }}
49+
prerelease: true
50+
generate_release_notes: true
51+
body: |
52+
NuGet: https://www.nuget.org/packages/BenchmarkDotNet/${{ steps.version.outputs.VERSION }}
53+
discussion_category_name: Announcements

‎.github/workflows/release.yaml‎

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ run-name: Release new version
44
on:
55
workflow_dispatch:
66

7-
env:
8-
DOTNET_VERSION: "8.0.410"
9-
107
jobs:
118
release:
129
runs-on: ubuntu-latest
@@ -28,11 +25,6 @@ jobs:
2825
ref: docs-changelog
2926
path: docs/_changelog
3027

31-
- name: Setup .NET Core
32-
uses: actions/setup-dotnet@v5
33-
with:
34-
dotnet-version: ${{ env.DOTNET_VERSION }}
35-
3628
- name: Read current version
3729
id: version
3830
run: echo "VERSION=$(grep -v '^$' build/versions.txt | tail -n 1)" >> $GITHUB_OUTPUT
@@ -68,7 +60,7 @@ jobs:
6860
run: ./build.cmd version-increment
6961

7062
- name: Commit changes
71-
uses: EndBug/add-and-commit@290ea2c423ad77ca9c62ae0f5b224379612c0321 # v10.0.0
63+
uses: EndBug/add-and-commit@cc9c08ba6c8df3b93a8f2db63e89b98368ae2ae8 # v11.1.1
7264
with:
7365
message: "Set next BenchmarkDotNet version: ${{ steps.version.outputs.VERSION }} and update released analyzer rules"
7466
author_name: GitHub Actions
@@ -90,20 +82,22 @@ jobs:
9082
tags: true
9183

9284
- name: Release
93-
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
85+
uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
9486
with:
95-
name: BenchmarkDotNet v${{ steps.version.outputs.VERSION }}
87+
name: v${{ steps.version.outputs.VERSION }}
9688
tag_name: v${{ steps.version.outputs.VERSION }}
9789
body: |
9890
Full changelog: https://benchmarkdotnet.org/changelog/v${{ steps.version.outputs.VERSION }}.html
9991
discussion_category_name: Announcements
10092

10193
- name: Close old milestone
102-
uses: Akkjon/close-milestone@2dd67f0346a3cb6159a33c7467ae5fbd17e5affc # v2.2.0
94+
run: |
95+
number=$(gh api "repos/${{ github.repository }}/milestones?state=open&per_page=100" --jq '.[] | select(.title == "v${{ steps.version.outputs.VERSION }}") | .number')
96+
if [ -n "$number" ]; then
97+
gh api -X PATCH "repos/${{ github.repository }}/milestones/$number" -f state=closed
98+
fi
10399
env:
104-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
105-
with:
106-
milestone_name: v${{ steps.version.outputs.VERSION }}
100+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
107101

108102
- name: Create new milestone
109103
uses: WyriHaximus/github-action-create-milestone@bcd9e15439836d6098d353a5bcf82de46591a35d # v1.1.2
@@ -113,7 +107,7 @@ jobs:
113107
title: v${{ steps.next_version.outputs.NEXT_VERSION }}
114108

115109
- name: Publish to NuGet
116-
run: dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
110+
run: ./.dotnet/dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
117111

118112
# --- Documentation ---
119113

@@ -128,7 +122,7 @@ jobs:
128122
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
129123

130124
- name: Push changelog
131-
uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0
125+
uses: JamesIves/github-pages-deploy-action@fa24774553152dd7873cd16ebd8d959b010c5445 # v4.9.0
132126
with:
133127
branch: docs-changelog
134128
folder: docs/_changelog
@@ -140,7 +134,7 @@ jobs:
140134
run: ./build.cmd docs-build
141135

142136
- name: Deploy documentation
143-
uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0
137+
uses: JamesIves/github-pages-deploy-action@fa24774553152dd7873cd16ebd8d959b010c5445 # v4.9.0
144138
with:
145139
branch: gh-pages
146140
folder: docs/_site

‎.github/workflows/run-tests-selected.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
timeout-minutes: 60 # Explicitly set timeout. When wrong input parameter is passed. It may continue to run until it times out (Default:360 minutes))
6161
steps:
6262
# Checkout
63-
- uses: actions/checkout@v4
63+
- uses: actions/checkout@v7
6464

6565
# Add Windows Defender Exclusions
6666
- uses: ./.github/actions/add-windowsdefender-exclusions

‎.github/workflows/run-tests.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,12 @@ jobs:
190190
runs-on: ubuntu-latest
191191
steps:
192192
- uses: actions/checkout@v7
193-
- uses: actions/setup-node@v6
193+
- uses: actions/setup-node@v7
194194
name: Setup node
195195
with:
196196
node-version: "24"
197197
- name: Install cSpell
198-
run: npm install -g cspell@9.7.0
198+
run: npm install -g cspell@10.3.3
199199
- name: Copy cSpell config
200200
run: cp ./build/cSpell.json ./cSpell.json
201201
- name: Run cSpell

0 commit comments

Comments
 (0)