Refactoring, multiple timeouts, code hardening and cleanup (#19) #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release to NuGet | |
| on: | |
| push: | |
| tags: | |
| - "v*.*.*" # Matches stable versions like v1.2.3 | |
| - "v*.*.*-*" # Matches pre-release versions like v2.0.1-beta | |
| jobs: | |
| build-and-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: "8.0.x" | |
| - name: Extract version from tag | |
| id: extract_version | |
| run: | | |
| TAG=${{ github.ref_name }} | |
| VERSION=${TAG#v} # Removes 'v' prefix | |
| echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV | |
| - name: Restore dependencies | |
| run: dotnet restore ./src/DataStax.AstraDB.DataApi/ | |
| - name: Build | |
| run: dotnet build ./src/DataStax.AstraDB.DataApi/ --configuration Release --no-restore | |
| - name: Pack | |
| run: dotnet pack ./src/DataStax.AstraDB.DataApi/ --configuration Release --no-build --output nupkgs -p:Version=${{ env.PACKAGE_VERSION }} | |
| - name: Push to NuGet | |
| run: dotnet nuget push nupkgs/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json | |
| env: | |
| NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | |
| - name: Upload NuGet package as artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nuget-package | |
| path: nupkgs/*.nupkg | |
| retention-days: 1 |