File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : Publish (Manual)
1+ name : Publish to NuGet
22
33on :
4- workflow_dispatch :
4+ workflow_dispatch : # Manual trigger
5+ push :
6+ tags :
7+ - ' v*' # Automatic trigger on version tags (v0.1.0, v1.0.0, etc.)
58
69env :
710 DOTNET_SKIP_FIRST_TIME_EXPERIENCE : 1
5053 publish :
5154 needs : pack
5255 runs-on : ubuntu-latest
53- if : github.event_name == 'workflow_dispatch'
56+ # Publish if manually triggered OR if tag was pushed
57+ if : github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/v')
5458 steps :
5559 - name : Download NuGet packages
5660 uses : actions/download-artifact@v4
Original file line number Diff line number Diff line change 1+ name : Release
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+
8+ permissions :
9+ contents : write # For creating releases and tags
10+ issues : write # For commenting on issues
11+ pull-requests : write # For commenting on PRs
12+
13+ jobs :
14+ release :
15+ name : Semantic Release
16+ runs-on : ubuntu-latest
17+ steps :
18+ - name : Checkout
19+ uses : actions/checkout@v4
20+ with :
21+ fetch-depth : 0 # Fetch all history for semantic-release
22+
23+ - name : Setup Node.js
24+ uses : actions/setup-node@v4
25+ with :
26+ node-version : 22
27+
28+ - name : Install dependencies
29+ run : npm ci
30+
31+ - name : Release
32+ env :
33+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
34+ run : npx semantic-release
Original file line number Diff line number Diff line change 77 [
88 " @semantic-release/exec" ,
99 {
10- "prepareCmd" : " sed -i '' ' s|<Version>.*</Version>|<Version>${nextRelease.version}</Version>|' src/Flowrex/Flowrex.csproj"
10+ "prepareCmd" : " sed -i 's|<Version>.*</Version>|<Version>${nextRelease.version}</Version>|' src/Flowrex/Flowrex.csproj"
1111 }
1212 ],
1313 [
Original file line number Diff line number Diff line change 1414 "devDependencies" : {
1515 "@commitlint/cli" : " ^18.4.3" ,
1616 "@commitlint/config-conventional" : " ^18.4.3" ,
17+ "@semantic-release/changelog" : " ^6.0.3" ,
18+ "@semantic-release/exec" : " ^7.1.0" ,
19+ "@semantic-release/git" : " ^10.0.1" ,
1720 "commitizen" : " ^4.3.0" ,
1821 "cz-conventional-changelog" : " ^3.3.0" ,
19- "husky" : " ^8.0.3"
22+ "husky" : " ^8.0.3" ,
23+ "semantic-release" : " ^24.2.9"
2024 },
2125 "config" : {
2226 "commitizen" : {
You can’t perform that action at this time.
0 commit comments