From 5f97dfa0930d3895da2ba41d20d12a6f36f0ce42 Mon Sep 17 00:00:00 2001 From: routersys Date: Wed, 24 Jun 2026 16:07:44 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=8A=E3=82=A4=E3=83=88=E3=83=AA=E3=83=BC?= =?UTF-8?q?=E5=85=AC=E9=96=8B=E3=82=92=E3=83=91=E3=83=83=E3=82=B1=E3=83=BC?= =?UTF-8?q?=E3=82=B8=20push=20=E3=81=8B=E3=82=89=20GitHub=20Release=20?= =?UTF-8?q?=E6=B7=BB=E4=BB=98=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dotnet.yml | 42 ++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index b3de1cbc..f7acfe1f 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -406,34 +406,30 @@ jobs: dotnet publish tests\ComputeSharp.Pix.NuGet\ComputeSharp.Pix.NuGet.csproj -r win-x64 -v n; tests\ComputeSharp.Pix.NuGet\bin\Release\net8.0\win-x64\publish\ComputeSharp.Pix.NuGet.exe - # Publish the packages to GitHub packages - publish-nightlies-github: + # ビルドした NuGet パッケージ(.nupkg)を GitHub Release として公開する。 + # GitHub Packages や Azure DevOps への push はフォークでは認証できず失敗する(403)ため、 + # 代わりに自動生成のリリースノートを付けたリリースを作成し、.nupkg を資産として添付する。 + publish-release: needs: [run-tests, run-tests-d3d12ma, run-tests-win2d, run-samples, run-samples-aot, verify-packages] runs-on: windows-2022 if: ${{github.event_name == 'push'}} + permissions: + contents: write steps: - - uses: actions/download-artifact@v4 + - name: Git checkout + uses: actions/checkout@v4 + - name: Download package artifacts + uses: actions/download-artifact@v4 with: name: nuget_packages path: artifacts - - run: dotnet nuget push "artifacts\*.nupkg" --source "https://nuget.pkg.github.com/${{github.repository_owner}}/index.json" --api-key ${{secrets.GITHUB_TOKEN}} --skip-duplicate - - # Publish the packages to Azure DevOps. This step has will not fail the CI even if it is not - # successful, so as to not block PRs and hinder development just because eg. the Azure storage - # has exceeded the limit. These packages are rarely needed anyway, so that's fine. - publish-nightlies-azure-devops: - needs: [run-tests, run-tests-d3d12ma, run-tests-win2d, run-samples, run-samples-aot, verify-packages] - runs-on: windows-2022 - if: ${{github.event_name == 'push'}} - steps: - - uses: actions/download-artifact@v4 - with: - name: nuget_packages - path: artifacts - - uses: actions/setup-dotnet@v4 - with: - source-url: "https://sergio0694.pkgs.visualstudio.com/ComputeSharp/_packaging/ComputeSharp/nuget/v3/index.json" + - name: Create GitHub release with NuGet packages + shell: bash env: - NUGET_AUTH_TOKEN: ${{ secrets.ADO_FEED_PERSONAL_ACCESS_TOKEN }} - - run: dotnet nuget push "artifacts\*.nupkg" --api-key AzureDevOps --skip-duplicate - continue-on-error: true + GH_TOKEN: ${{secrets.GITHUB_TOKEN}} + run: | + gh release create "${{github.sha}}" artifacts/*.nupkg \ + --target "${{github.sha}}" \ + --title "Nightly build ${{github.sha}}" \ + --generate-notes \ + --prerelease