Skip to content

Commit 3a44bc1

Browse files
add dry run release ci
1 parent 8154a68 commit 3a44bc1

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Release to NuGet
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*' # Matches stable versions like v1.2.3
7+
- 'v*.*.*-*' # Matches pre-release versions like v2.0.1-beta
8+
9+
jobs:
10+
build-and-release:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Setup .NET
18+
uses: actions/setup-dotnet@v4
19+
with:
20+
dotnet-version: '8.0.x' # Adjust to your .NET version
21+
22+
- name: Restore dependencies
23+
run: dotnet restore ./src/DataStax.AstraDB.DataApi/
24+
25+
- name: Build
26+
run: dotnet build ./src/DataStax.AstraDB.DataApi/ --configuration Release --no-restore
27+
28+
- name: Pack
29+
run: dotnet pack ./src/DataStax.AstraDB.DataApi/ --configuration Release --no-build --output nupkgs -p:Version=${{ env.PACKAGE_VERSION }}
30+
env:
31+
PACKAGE_VERSION: ${{ replace(github.ref_name, 'v', '') }}
32+
33+
# - name: Push to NuGet
34+
# run: dotnet nuget push nupkgs/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json
35+
# env:
36+
# NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
37+
38+
- name: Dry-run NuGet push
39+
run: echo "Would run: dotnet nuget push nupkgs/*.nupkg --api-key [REDACTED] --source https://api.nuget.org/v3/index.json"
40+
41+
- name: Upload NuGet package as artifact
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: nuget-package
45+
path: nupkgs/*.nupkg
46+
retention-days: 1

0 commit comments

Comments
 (0)