diff --git a/.github/workflows/preview-nugets.yml b/.github/workflows/preview-nugets.yml new file mode 100644 index 000000000..668f18587 --- /dev/null +++ b/.github/workflows/preview-nugets.yml @@ -0,0 +1,62 @@ +name: Preview NuGet packages + +on: + push: + branches: + - "ci/**" + - "feat/**" + - "fix/**" + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + meta: + uses: ./.github/workflows/part-compute-version.yml + secrets: inherit + with: + prereleaseSlug: preview + + build-nuget: + runs-on: ubuntu-latest + needs: meta + + env: + COALESCE_VERSION: ${{ needs.meta.outputs.COALESCE_VERSION }} + + steps: + - uses: actions/checkout@v6 + - uses: ./.github/actions/setup-dotnet + - uses: ./.github/actions/setup-js + - run: dotnet restore + - run: dotnet build --no-restore --configuration Release /WarnAsError + - run: dotnet pack --no-build --configuration Release -p:PackageOutputPath="$(pwd)/out/packages" + + - name: Upload NuGet packages artifact + uses: actions/upload-artifact@v7 + with: + name: packages + path: out/packages + + publish-nuget: + runs-on: ubuntu-latest + needs: [build-nuget] + permissions: + contents: read + packages: write + + steps: + - uses: actions/setup-dotnet@v4 + with: + dotnet-version: 10.0.x + + - name: Download NuGet packages artifact + uses: actions/download-artifact@v8 + with: + name: packages + path: out/packages + + - name: Push packages to GitHub Packages + run: dotnet nuget push "out/packages/*.nupkg" --source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" --api-key ${{ github.token }} --skip-duplicate