Skip to content

Commit e4f7752

Browse files
authored
Build with Github Actions instead of ADO pipelines (#574)
Other repos are moving onto Github Actions, it's recommended that Lottie-Windows does so as well. Converted the steps in azure-pipelines.yml into Github Actions equivalents using online references and Maui.Markup as an example. Additionally as part of this change, the package signing tool has been upgraded from 'signclient' (now deprecated) to 'sign'.
1 parent 7a338f6 commit e4f7752

File tree

3 files changed

+166
-78
lines changed

3 files changed

+166
-78
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/CommunityToolkit.*

.github/workflows/dotnet-build.yml

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- dev/*
8+
- rel/*
9+
paths-ignore:
10+
- README.md
11+
pull_request:
12+
branches:
13+
- main
14+
- dev/*
15+
- rel/*
16+
paths-ignore:
17+
- README.md
18+
19+
env:
20+
BuildConfiguration: Lottie-Windows
21+
NET_VERSION: '9.0.x'
22+
NUGET_VERSION: '6.5.0'
23+
24+
jobs:
25+
build_lottie:
26+
runs-on: windows-latest
27+
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 0
33+
34+
# Set up a VS build environment.
35+
- name: Setup Environment Variables
36+
run: |
37+
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -no_logo
38+
shell: cmd
39+
40+
# Install NuGet tools.
41+
- name: Setup NuGet
42+
uses: NuGet/setup-nuget@v2
43+
with:
44+
nuget-version: ${{ env.NUGET_VERSION }}
45+
46+
# Install Nerbank.GitVersioning.
47+
- name: Install NBGV tool
48+
run: dotnet tool install --tool-path . nbgv
49+
50+
# .NET Core 9 SDK Installer.
51+
- name: Setup .NET SDK
52+
uses: actions/setup-dotnet@v4
53+
with:
54+
dotnet-version: ${{ env.NET_VERSION }}
55+
56+
# Nerdbank.GitVersioning
57+
- name: Set Version
58+
run: nbgv cloud
59+
60+
# Install the Windows SDK.
61+
# This is needed to build the UWP code.
62+
- name: Install Windows SDK
63+
run: .\build\Install-WindowsSdkISO.ps1 18362
64+
shell: pwsh
65+
66+
# Run the build.
67+
- name: Build
68+
run: .\build.ps1 --target=Package
69+
shell: pwsh
70+
working-directory: .\build
71+
72+
- name: Upload Package List
73+
uses: actions/upload-artifact@v4
74+
with:
75+
name: nuget-list
76+
if-no-files-found: error
77+
path: |
78+
${{ github.workspace }}/.github/workflows/SignClientFileList.txt
79+
80+
# Publish the results of the build.
81+
- name: Publish Packages
82+
uses: actions/upload-artifact@v4
83+
with:
84+
name: packages
85+
path: .\bin\nupkg
86+
87+
sign:
88+
needs: [build_lottie]
89+
runs-on: windows-latest
90+
permissions:
91+
id-token: write # Required for requesting the JWT
92+
93+
steps:
94+
- name: Install .NET SDK v${{ env.NET_VERSION }}
95+
uses: actions/setup-dotnet@v4
96+
with:
97+
dotnet-version: ${{ env.NET_VERSION }}
98+
dotnet-quality: 'ga'
99+
100+
- name: Download NuGet List
101+
uses: actions/download-artifact@v4
102+
with:
103+
name: nuget-list
104+
path: ./
105+
106+
- name: Download Package List
107+
uses: actions/download-artifact@v4
108+
with:
109+
name: packages
110+
path: ./packages
111+
112+
- name: Install Signing Tool
113+
run: dotnet tool install --tool-path ./tools sign --version 0.9.1-beta.23356.1
114+
115+
- name: Sign Packages
116+
run: >
117+
./tools/sign code azure-key-vault
118+
**/*.nupkg
119+
--base-directory "${{ github.workspace }}/packages"
120+
--file-list "${{ github.workspace }}/SignClientFileList.txt"
121+
--timestamp-url "http://timestamp.digicert.com"
122+
--publisher-name ".NET Foundation"
123+
--description "Windows Community Toolkit"
124+
--description-url "https://developer.microsoft.com/en-us/windows/uwp-community-toolkit"
125+
--azure-key-vault-url "${{ secrets.SIGN_KEY_VAULT_URL }}"
126+
--azure-key-vault-client-id ${{ secrets.SIGN_CLIENT_ID }}
127+
--azure-key-vault-client-secret "${{ secrets.SIGN_CLIENT_SECRET }}"
128+
--azure-key-vault-tenant-id ${{ secrets.SIGN_TENANT_ID }}
129+
--azure-key-vault-certificate "${{ secrets.SIGN_CERTIFICATE }}"
130+
--verbosity Information
131+
132+
- name: Publish Packages
133+
uses: actions/upload-artifact@v4
134+
with:
135+
name: signed-packages
136+
if-no-files-found: error
137+
path: |
138+
${{ github.workspace }}/packages/**/*.nupkg
139+
140+
release:
141+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
142+
needs: [sign]
143+
environment: nuget-release-gate # This gates this job until manually approved
144+
runs-on: ubuntu-latest
145+
146+
steps:
147+
- name: Install .NET SDK
148+
uses: actions/setup-dotnet@v4
149+
with:
150+
dotnet-version: ${{ env.NET_VERSION }}
151+
dotnet-quality: 'ga'
152+
153+
- name: Download signed packages for ${{ matrix.platform }}
154+
uses: actions/download-artifact@v4
155+
with:
156+
name: signed-packages
157+
path: ./packages
158+
159+
- name: Push to NuGet.org
160+
run: >
161+
dotnet nuget push
162+
**/*.nupkg
163+
--source https://api.nuget.org/v3/index.json
164+
--api-key ${{ secrets.NUGET_PACKAGE_PUSH_TOKEN }}
165+
--skip-duplicate

azure-pipelines.yml

Lines changed: 0 additions & 78 deletions
This file was deleted.

0 commit comments

Comments
 (0)