-
-
Notifications
You must be signed in to change notification settings - Fork 397
104 lines (104 loc) · 4.48 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: CI Build
on:
push:
branches:
- 'main'
- 'release/**'
paths-ignore:
- 'documentation/**'
tags:
- '*'
pull_request:
# all branches
paths-ignore:
- 'documentation/**'
permissions:
packages: write
jobs:
Build:
runs-on: macos-13-xlarge
steps:
- uses: actions/[email protected]
with:
submodules: 'false'
- name: Clone submodules non-recursively
run: git submodule update --init --depth 0
- name: Setup Java JDK 21
uses: actions/[email protected]
with:
java-version: 21
distribution: "temurin"
- name: Setup Android Environment
uses: android-actions/setup-android@v2
env:
ANDROID_SDK_ROOT: /Users/runner/Library/Android/sdk
- name: Install Android Platforms
run: |
sdkmanager --install "build-tools;32.0.0"
sdkmanager --install "platform-tools"
sdkmanager --install "platforms;android-31"
sdkmanager --install "platforms;android-33"
sdkmanager --install "platforms;android-34"
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.414
- name: Setup .NET 7.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.102
- name: Install Workloads
run: dotnet workload install android ios maccatalyst
- name: Test
if: ${{ github.repository != 'dotnet/Silk.NET' || !startsWith(github.ref, 'refs/tags/') }}
# skip Clean, Restore, and Compile as this will build the affect the whole solution.
# dotnet test will compile the necessary projects for testing only.
run: ./build.sh Test --skip Clean Restore Compile
- name: Validation Checks
if: ${{ github.repository != 'dotnet/Silk.NET' || !startsWith(github.ref, 'refs/tags/') }}
run: ./build.sh ValidateSolution
- name: Pack (CI)
if: ${{ github.repository != 'dotnet/Silk.NET' || !startsWith(github.ref, 'refs/tags/') }}
# Use a release NUKE so it doesn't interfere with the debug build
run: dotnet run --project build/nuke/Silk.NET.NUKE.csproj -c Release -- Pack --configuration Debug --msbuild-properties VersionSuffix=${{ github.event_name != 'pull_request' && format('build{0}.0', github.run_number) || format('pr{0}.{1}', github.event.number, github.run_number) }} ContinuousIntegrationBuild=true
env:
ANDROID_HOME: /Users/runner/Library/Android/sdk
- name: Pack (CD)
if: ${{ github.repository == 'dotnet/Silk.NET' && startsWith(github.ref, 'refs/tags/') }}
run: ./build.sh Pack --configuration Release --msbuild-properties ContinuousIntegrationBuild=true
- name: Upload Unsigned Artifacts to Actions
uses: actions/upload-artifact@v4
with:
name: unsigned_nupkgs
path: "build/output_packages/*nupkg"
if-no-files-found: warn
retention-days: 1
- name: Push to Experimental Feed
if: ${{ github.repository == 'dotnet/Silk.NET' }}
run: ./build.sh PushToNuGet --skip Clean Restore Compile Pack --nuget-feed https://dotnet.github.io/Silk.NET/nuget/experimental/index.json --nuget-username ${{ secrets.EXP_NUGET_USERNAME }} --nuget-password ${{ secrets.EXP_NUGET_PASSWORD }} --nuget-api-key ${{ secrets.EXP_NUGET_PASSWORD }}
- name: Push to GitHub Packages
if: ${{ github.repository == 'dotnet/Silk.NET' }}
run: ./build.sh PushToNuGet --skip Clean Restore Compile Pack --nuget-feed https://nuget.pkg.github.com/dotnet/index.json --nuget-api-key ${{ secrets.GITHUB_TOKEN }}
PushRelease:
name: Push Release to NuGet
runs-on: windows-latest
if: ${{ github.repository == 'dotnet/Silk.NET' && startsWith(github.ref, 'refs/tags/') }}
needs: [Build]
steps:
- uses: actions/[email protected]
with:
submodules: 'false'
- uses: actions/download-artifact@v4
with:
name: unsigned_nupkgs
path: build/output_packages
- name: Sign Packages
run: .\build.cmd SignPackages --akv-certificate ${{ secrets.AKV_CERTIFICATE }} --akv-client-id ${{ secrets.AKV_CLIENT_ID }} --akv-client-secret ${{ secrets.AKV_CLIENT_SECRET }} --akv-tenant ${{ secrets.AKV_TENANT }} --akv-vault-url ${{ secrets.AKV_VAULT_URL }}
- name: Upload Signed Artifacts to Actions
uses: actions/upload-artifact@v4
with:
name: signed_nupkgs
path: "build/output_packages/*nupkg"
if-no-files-found: warn
- name: Push to NuGet
run: .\build.cmd PushToNuGet --skip Clean Restore Pack --nuget-api-key ${{ secrets.NUGET_TOKEN }}