From e6451438e2147c0845bf704c3a2d1582816a4901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agn=C3=A8s=20ZITTE?= <16295702+agneszitte@users.noreply.github.com> Date: Thu, 12 Sep 2024 18:16:29 -0400 Subject: [PATCH] ci: Fix artifact handling for GitHub Actions v4 - Updated artifact upload steps to assign unique names (NuGet-Fluent, NuGet-Roboto, NuGet-OpenSans) to address changes introduced in actions/upload-artifact@v4. - Modified publish job to download artifacts by job-scoped names into separate directories (artifacts/fluent, artifacts/roboto, artifacts/opensans). - Adjusted signing and pushing steps to ensure consistent handling of artifacts across jobs and publishing. (cherry picked from commit 28b88be8405a0ea80ebda7bf1f8b2e959744d0af) # Conflicts: # .github/workflows/ci.yml --- .github/workflows/ci.yml | 86 ++++++++++++++++++++++++++++++++-------- 1 file changed, 69 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f01ad30..30a1baf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 - + - name: Setup .NET uses: actions/setup-dotnet@v1 with: @@ -51,16 +51,22 @@ jobs: rm *.cs dotnet build -c Release cp bin\Release\netstandard2.0\uno.fonts.fluent.dll ../Fluent - + - name: Pack run: | $adjustedPackageVersion="${{ steps.gitversion.outputs.semVer }}".ToLower(); build/nuget.exe pack nuget/Fluent/Uno.Fonts.Fluent.nuspec -Version $adjustedPackageVersion -OutputDirectory ./artifacts +<<<<<<< HEAD - name: Upload Artifacts uses: actions/upload-artifact@v2 +======= + + - name: Upload Fluent Artifacts # Changed to have unique name for artifacts + uses: actions/upload-artifact@v4 +>>>>>>> 28b88be (ci: Fix artifact handling for GitHub Actions v4) with: - name: NuGet + name: NuGet-Fluent path: ./artifacts build_roboto: @@ -73,7 +79,7 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 - + - name: Setup .NET uses: actions/setup-dotnet@v1 with: @@ -108,10 +114,15 @@ jobs: $adjustedPackageVersion="${{ steps.gitversion.outputs.semVer }}".ToLower(); msbuild nuget\Roboto\Uno.Fonts.Roboto\Uno.Fonts.Roboto.csproj -t:pack -p:Configuration=Release -p:PackageVersion=$adjustedPackageVersion -p:PackageOutputPath=artifacts +<<<<<<< HEAD - name: Upload Artifacts uses: actions/upload-artifact@v2 +======= + - name: Upload Roboto Artifacts # Changed to have unique name for artifacts + uses: actions/upload-artifact@v4 +>>>>>>> 28b88be (ci: Fix artifact handling for GitHub Actions v4) with: - name: NuGet + name: NuGet-Roboto path: nuget\Roboto\Uno.Fonts.Roboto\artifacts build_opensans: @@ -124,7 +135,7 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 - + - name: Setup .NET uses: actions/setup-dotnet@v1 with: @@ -147,10 +158,15 @@ jobs: $adjustedPackageVersion="${{ steps.gitversion.outputs.semVer }}".ToLower(); dotnet pack nuget\OpenSans\Uno.Fonts.OpenSans\Uno.Fonts.OpenSans.csproj -c Release -p:PackageVersion=$adjustedPackageVersion -p:PackageOutputPath=artifacts +<<<<<<< HEAD - name: Upload Artifacts uses: actions/upload-artifact@v2 +======= + - name: Upload OpenSans Artifacts # Changed to have unique name for artifacts + uses: actions/upload-artifact@v4 +>>>>>>> 28b88be (ci: Fix artifact handling for GitHub Actions v4) with: - name: NuGet + name: NuGet-OpenSans path: nuget\OpenSans\Uno.Fonts.OpenSans\artifacts publish: @@ -160,20 +176,30 @@ jobs: runs-on: windows-latest needs: [build_fluent, build_roboto, build_opensans] steps: - - name: Checkout - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v2 +<<<<<<< HEAD - name: Download Artifacts uses: actions/download-artifact@v2 with: name: NuGet path: artifacts +======= + - name: Download Fluent Artifacts # Adjusted to download specific artifact + uses: actions/download-artifact@v4 + with: + name: NuGet-Fluent + path: artifacts/fluent +>>>>>>> 28b88be (ci: Fix artifact handling for GitHub Actions v4) - - name: Setup .NET SDK - uses: actions/setup-dotnet@v1 - with: - dotnet-version: '3.1.x' + - name: Download Roboto Artifacts # Adjusted to download specific artifact + uses: actions/download-artifact@v4 + with: + name: NuGet-Roboto + path: artifacts/roboto +<<<<<<< HEAD - name: Setup SignClient run: | dotnet tool install --tool-path build SignClient @@ -187,8 +213,34 @@ jobs: with: name: NuGet-Signed path: ./artifacts +======= + - name: Download OpenSans Artifacts # Adjusted to download specific artifact + uses: actions/download-artifact@v4 + with: + name: NuGet-OpenSans + path: artifacts/opensans +>>>>>>> 28b88be (ci: Fix artifact handling for GitHub Actions v4) - - name: NuGet Push - shell: pwsh - run: | - dotnet nuget push artifacts\*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_ORG_API_KEY }} + - name: Setup .NET SDK + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '3.1.x' + + - name: Setup SignClient + run: | + dotnet tool install --tool-path build SignClient + - name: SignClient + shell: pwsh + run: | + build\SignClient sign -i artifacts\*.nupkg -c build\SignClient.json -r "${{ secrets.UNO_PLATFORM_CODESIGN_USERNAME }}" -s "${{ secrets.UNO_PLATFORM_CODESIGN_SECRET }}" -n "Uno.Check" -d "Uno.Check" -u "https://github.com/unoplatform/uno.check" + + - name: Upload Signed Artifacts + uses: actions/upload-artifact@v4 + with: + name: NuGet-Signed + path: ./artifacts + + - name: NuGet Push + shell: pwsh + run: | + dotnet nuget push artifacts\*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_ORG_API_KEY }}