Fix release process #5
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 NuGet Packages | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| env: | |
| DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | |
| DOTNET_CLI_TELEMETRY_OPTOUT: true | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '9.0.x' | |
| - name: Extract version from tag | |
| id: version | |
| run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
| - name: Pack and Push libraries in dependency order | |
| env: | |
| VERSION: ${{ steps.version.outputs.VERSION }} | |
| NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | |
| run: | | |
| set -euo pipefail | |
| PACKAGES=( | |
| # Tier 0 | |
| "Other/Nimblesite.Sql.Model/Nimblesite.Sql.Model.csproj" | |
| # Tier 1 | |
| "DataProvider/Nimblesite.DataProvider.Core/Nimblesite.DataProvider.Core.csproj" | |
| "Lql/Nimblesite.Lql.Core/Nimblesite.Lql.Core.csproj" | |
| "Migration/Nimblesite.DataProvider.Migration.Core/Nimblesite.DataProvider.Migration.Core.csproj" | |
| # Tier 2 | |
| "DataProvider/Nimblesite.DataProvider.SQLite/Nimblesite.DataProvider.SQLite.csproj" | |
| "DataProvider/Nimblesite.DataProvider.SqlServer/Nimblesite.DataProvider.SqlServer.csproj" | |
| "Lql/Nimblesite.Lql.SQLite/Nimblesite.Lql.SQLite.csproj" | |
| "Lql/Nimblesite.Lql.Postgres/Nimblesite.Lql.Postgres.csproj" | |
| "Lql/Nimblesite.Lql.SqlServer/Nimblesite.Lql.SqlServer.csproj" | |
| "Migration/Nimblesite.DataProvider.Migration.SQLite/Nimblesite.DataProvider.Migration.SQLite.csproj" | |
| "Migration/Nimblesite.DataProvider.Migration.Postgres/Nimblesite.DataProvider.Migration.Postgres.csproj" | |
| "Sync/Nimblesite.Sync.Core/Nimblesite.Sync.Core.csproj" | |
| # Tier 3 | |
| "Sync/Nimblesite.Sync.SQLite/Nimblesite.Sync.SQLite.csproj" | |
| "Sync/Nimblesite.Sync.Postgres/Nimblesite.Sync.Postgres.csproj" | |
| # Tier 4 | |
| "Sync/Nimblesite.Sync.Http/Nimblesite.Sync.Http.csproj" | |
| ) | |
| for proj in "${PACKAGES[@]}"; do | |
| name=$(basename "$proj" .csproj) | |
| echo "::group::Pack and push $name" | |
| dotnet pack "$proj" -c Release -p:Version="$VERSION" -o ./nupkgs | |
| dotnet nuget push "./nupkgs/${name}.${VERSION}.nupkg" \ | |
| --api-key "$NUGET_API_KEY" \ | |
| --source https://api.nuget.org/v3/index.json \ | |
| --skip-duplicate | |
| echo "::endgroup::" | |
| done | |
| - name: Create GitHub Release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: gh release create "${{ github.ref_name }}" --generate-notes | |
| deploy-lql-website: | |
| needs: publish | |
| uses: ./.github/workflows/deploy-lql-website.yml | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| deploy-website: | |
| needs: deploy-lql-website | |
| uses: ./.github/workflows/deploy-website.yml | |
| secrets: inherit | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write |