Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Fix artifact handling for GitHub Actions v4 (backport #52) #55

Merged
merged 3 commits into from
Sep 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 51 additions & 31 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,19 +160,20 @@ 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

- name: Download Artifacts
uses: actions/download-artifact@v4
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

- 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

- name: Setup SignClient
run: |
Expand All @@ -182,13 +183,32 @@ jobs:
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: Download OpenSans Artifacts # Adjusted to download specific artifact
uses: actions/download-artifact@v4
with:
name: NuGet-OpenSans
path: artifacts/opensans

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