-
-
Notifications
You must be signed in to change notification settings - Fork 1k
149 lines (118 loc) · 4.26 KB
/
release.yaml
File metadata and controls
149 lines (118 loc) · 4.26 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: release
run-name: Release new version
on:
workflow_dispatch:
env:
DOTNET_VERSION: "8.0.410"
jobs:
release:
runs-on: ubuntu-latest
environment: deploy # Only maintainers can execute this workflow
permissions:
contents: write
discussions: write
issues: write
steps:
# --- Init ---
- name: Checkout sources
uses: actions/checkout@v6
- name: Checkout changelog
uses: actions/checkout@v6
with:
ref: docs-changelog
path: docs/_changelog
- name: Setup .NET Core
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Read current version
id: version
run: echo "VERSION=$(grep -v '^$' build/versions.txt | tail -n 1)" >> $GITHUB_OUTPUT
# --- Main ---
- name: Tag release
run: git tag v${{ steps.version.outputs.VERSION }}
- name: Build
run: ./build.cmd build --stable /p:WeaverVersionSuffix=\"\"
- name: Pack
run: ./build.cmd pack --stable /p:WeaverVersionSuffix=\"\"
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: nupkgs
path: artifacts/*.nupkg
# --- Analyzer Rules and Next Version ---
- name: Move analyzer rules
run: ./build.cmd move-analyzer-rules
- name: Generate changelog
run: ./build.cmd docs-generate --stable
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Version increment
run: ./build.cmd version-increment
- name: Commit changes
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4
with:
message: "Set next BenchmarkDotNet version: ${{ steps.version.outputs.VERSION }} and update released analyzer rules"
author_name: GitHub Actions
author_email: actions@github.com
committer_name: GitHub Actions
committer_email: actions@github.com
- name: Read next version
id: next_version
run: echo "NEXT_VERSION=$(grep -v '^$' build/versions.txt | tail -n 1)" >> $GITHUB_OUTPUT
# --- Release ---
- name: Push git changes
uses: ad-m/github-push-action@77c5b412c50b723d2a4fbc6d71fb5723bcd439aa # v1.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: master
tags: true
- name: Release
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
with:
name: BenchmarkDotNet v${{ steps.version.outputs.VERSION }}
tag_name: v${{ steps.version.outputs.VERSION }}
body: |
Full changelog: https://benchmarkdotnet.org/changelog/v${{ steps.version.outputs.VERSION }}.html
discussion_category_name: Announcements
- name: Close old milestone
uses: Akkjon/close-milestone@v2.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
milestone_name: v${{ steps.version.outputs.VERSION }}
- name: Create new milestone
uses: WyriHaximus/github-action-create-milestone@bcd9e15439836d6098d353a5bcf82de46591a35d # v1.1.2
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
title: v${{ steps.next_version.outputs.NEXT_VERSION }}
- name: Publish to NuGet
run: dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
# --- Documentation ---
- name: Fetch changelog
run: ./build.cmd docs-fetch --depth 2 --preview
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Generate changelog
run: ./build.cmd docs-generate --preview
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push changelog
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: docs-changelog
folder: docs/_changelog
git-config-name: GitHub Actions
git-config-email: actions@github.com
clean: true
- name: Build documentation
run: ./build.cmd docs-build
- name: Deploy documentation
uses: JamesIves/github-pages-deploy-action@9d877eea73427180ae43cf98e8914934fe157a1a # v4.7.6
with:
branch: gh-pages
folder: docs/_site
git-config-name: GitHub Actions
git-config-email: actions@github.com
clean: true