Skip to content

Commit fe9bbd6

Browse files
committed
chore: add semantic release pre-release on main
1 parent a8269e5 commit fe9bbd6

File tree

5 files changed

+101
-22
lines changed

5 files changed

+101
-22
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: .NET Pre-Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
semantic-release:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: write
17+
issues: write
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 1
22+
23+
- name: Setup .NET
24+
uses: actions/setup-dotnet@v3
25+
with:
26+
dotnet-version: 9.x
27+
28+
- name: Setup Semantic Release
29+
run: |
30+
npm install https://github.com/buehler/semantic-release#feat/force-pre-release
31+
npm install \
32+
@semantic-release/github \
33+
@semantic-release/commit-analyzer \
34+
@semantic-release/release-notes-generator \
35+
semantic-release-net
36+
37+
- name: Semantic Release
38+
run: npx https://github.com/buehler/semantic-release#feat/force-pre-release -e ./.release/release.base.mjs -e ./.release/release.main-pre.mjs
39+
env:
40+
DEBUG: semantic-release:*
41+
NUGET_API_KEY: ${{ secrets.NUGET_KEY }}
42+
GH_NUGET_API_KEY: ${{ secrets.GITHUB_TOKEN }}
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/dotnet-release.yml

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,17 @@ on:
55
schedule:
66
- cron: "0 12 * * 2,5"
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
semantic-release:
1013
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
issues: write
1117
steps:
12-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
1319
with:
1420
fetch-depth: 1
1521

@@ -18,28 +24,17 @@ jobs:
1824
with:
1925
dotnet-version: 9.x
2026

21-
- name: Semantic Release
22-
uses: cycjimmy/semantic-release-action@v4
23-
with:
24-
semantic_version: 21
25-
extra_plugins: |
27+
- name: Setup Semantic Release
28+
run: |
29+
npm install https://github.com/buehler/semantic-release#feat/force-pre-release
30+
npm install \
31+
@semantic-release/github \
32+
@semantic-release/commit-analyzer \
33+
@semantic-release/release-notes-generator \
2634
semantic-release-net
27-
branches: |
28-
[
29-
"main",
30-
{
31-
"name": "maintenance/7.x",
32-
"range": "7.x"
33-
},
34-
{
35-
"name": "maintenance/8.x",
36-
"range": "8.x"
37-
},
38-
{
39-
"name": "maintenance/9.x",
40-
"range": "9.x"
41-
}
42-
]
35+
36+
- name: Semantic Release
37+
run: npx https://github.com/buehler/semantic-release#feat/force-pre-release -e ./.release/release.base.mjs -e ./.release/release.main.mjs
4338
env:
4439
DEBUG: semantic-release:*
4540
NUGET_API_KEY: ${{ secrets.NUGET_KEY }}

.release/release.base.mjs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
export default {
2+
debug: true,
3+
plugins: [
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
[
7+
"semantic-release-net",
8+
{
9+
sources: [
10+
{
11+
url: "https://api.nuget.org/v3/index.json",
12+
apiKeyEnvVar: "NUGET_API_KEY",
13+
},
14+
{
15+
url: "https://nuget.pkg.github.com/dotnet/index.json",
16+
apiKeyEnvVar: "GH_NUGET_API_KEY",
17+
},
18+
],
19+
},
20+
],
21+
[
22+
"@semantic-release/github",
23+
{
24+
successComment: false,
25+
failComment: false,
26+
releasedLabels: false,
27+
assets: [
28+
{
29+
path: "src/**/bin/Release/**/*.nupkg",
30+
},
31+
],
32+
},
33+
],
34+
],
35+
};

.release/release.main-pre.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default {
2+
branches: [{ name: "main", prerelease: "prerelease" }],
3+
};

.release/release.main.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default {
2+
branches: ["main"],
3+
};

0 commit comments

Comments
 (0)