Skip to content

Commit

Permalink
Merge pull request #52 from unoplatform/dev/agzi/FixNugetPackagesPubl…
Browse files Browse the repository at this point in the history
…ication

ci: Fix artifact handling for GitHub Actions v4
  • Loading branch information
jeromelaban authored Sep 13, 2024
2 parents 959676c + de17c3a commit 33acb3d
Showing 1 changed file with 55 additions and 43 deletions.
98 changes: 55 additions & 43 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
Expand All @@ -51,16 +51,16 @@ 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
- name: Upload Artifacts
- name: Upload Fluent Artifacts # Changed to have unique name for artifacts
uses: actions/upload-artifact@v4
with:
name: NuGet
name: NuGet-Fluent
path: ./artifacts

build_roboto:
Expand All @@ -73,7 +73,7 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
Expand Down Expand Up @@ -108,10 +108,10 @@ 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
- name: Upload Artifacts
- name: Upload Roboto Artifacts # Changed to have unique name for artifacts
uses: actions/upload-artifact@v4
with:
name: NuGet
name: NuGet-Roboto
path: nuget\Roboto\Uno.Fonts.Roboto\artifacts

build_opensans:
Expand All @@ -124,7 +124,7 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
Expand All @@ -147,10 +147,10 @@ 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
- name: Upload Artifacts
- name: Upload OpenSans Artifacts # Changed to have unique name for artifacts
uses: actions/upload-artifact@v4
with:
name: NuGet
name: NuGet-OpenSans
path: nuget\OpenSans\Uno.Fonts.OpenSans\artifacts

publish:
Expand All @@ -160,35 +160,47 @@ jobs:
runs-on: windows-latest
needs: [build_fluent, build_roboto, build_opensans]
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: NuGet
path: artifacts

- 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 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 }}
- name: Checkout
uses: actions/checkout@v2

- name: Download Fluent Artifacts # Adjusted to download specific artifact
uses: actions/download-artifact@v4
with:
name: NuGet-Fluent
path: artifacts/fluent

- name: Download Roboto Artifacts # Adjusted to download specific artifact
uses: actions/download-artifact@v4
with:
name: NuGet-Roboto
path: artifacts/roboto

- name: Download OpenSans Artifacts # Adjusted to download specific artifact
uses: actions/download-artifact@v4
with:
name: NuGet-OpenSans
path: artifacts/opensans

- 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 }}

0 comments on commit 33acb3d

Please sign in to comment.