-
Notifications
You must be signed in to change notification settings - Fork 13
203 lines (193 loc) · 6.71 KB
/
main.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
name: CI
on: [pull_request, push]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build-docker:
strategy:
fail-fast: false
matrix:
include:
- container: wpilib/roborio-cross-ubuntu:2023-22.04
artifact-name: Athena
build-options: "-Pplatform=linux-athena"
- container: wpilib/raspbian-cross-ubuntu:bullseye-22.04
artifact-name: Arm32
build-options: "-Pplatform=linux-arm32"
- container: wpilib/aarch64-cross-ubuntu:bullseye-22.04
artifact-name: Arm64
build-options: "-Pplatform=linux-arm64"
- container: wpilib/ubuntu-base:22.04
artifact-name: Linux
build-options: ""
name: "Build - ${{ matrix.artifact-name }}"
runs-on: ubuntu-latest
container: ${{ matrix.container }}
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- run: sudo apt-get update && sudo apt-get install ant -y && sudo rm -rf /var/lib/apt/lists/* && sudo rm -f /bin/ant && sudo ln -s /usr/share/ant/bin/ant /bin/ant
name: Install Ant
- run: ./gradlew build -PjenkinsBuild ${{ matrix.build-options }}
name: Build with Gradle
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.artifact-name }}
path: gradleDir/outputs/
build-windows:
strategy:
fail-fast: false
matrix:
include:
- artifact-name: Win64Release
architecture: x64
build-options: "-PskipDebug"
- artifact-name: Win32Release
architecture: x86
build-options: "-PskipDebug"
- artifact-name: WinArm64Release
architecture: x64
build-options: "-PskipDebug -Pplatform=windows-arm64"
- artifact-name: Win64
architecture: x64
build-options: "-PskipRelease -PskipSources"
- artifact-name: Win32
architecture: x86
build-options: "-PskipRelease -PskipSources"
- artifact-name: WinArm64
architecture: x64
build-options: "-PskipRelease -PskipSources -Pplatform=windows-arm64"
name: "Build - ${{ matrix.artifact-name }}"
runs-on: windows-2019
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'zulu'
architecture: ${{ matrix.architecture }}
- name: Set Java Heap Size
run: sed -i 's/-Xmx2g/-Xmx1g/g' gradle.properties
if: matrix.architecture == 'x86'
- run: |
@call "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Auxiliary\\Build\\vcvars64.bat"
set PATH=%PATH%;%ANT_HOME%\bin
gradlew build -PjenkinsBuild ${{ matrix.build-options }}
shell: cmd
name: Build with Gradle
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.artifact-name }}
path: gradleDir/outputs/
build-mac:
name: "Build - macOS"
runs-on: macOS-11
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'zulu'
- run: ./gradlew build -PjenkinsBuild
name: Build with Gradle
- uses: actions/upload-artifact@v3
with:
name: macOS
path: gradleDir/outputs/
build-mac-arm:
name: "Build - macOS (Arm)"
runs-on: macos-11
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'zulu'
- run: ./gradlew build -PjenkinsBuild -Pforcealternatemacbuild
name: Build with Gradle
- uses: actions/upload-artifact@v3
with:
name: macOSArm
path: gradleDir/outputs/
make_universal:
name: Make Universal
needs: [build-mac, build-mac-arm]
runs-on: macos-11
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: macOS
path: build/downloads
- uses: actions/download-artifact@v3
with:
name: macOSArm
path: build/downloads
- uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'zulu'
- run: ./gradlew copyToUpload -Prunmerge
name: Build with Gradle
if: |
github.repository_owner != 'wpilibsuite' ||
(github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/v'))
- name: Import Developer ID Certificate
uses: wpilibsuite/import-signing-certificate@v1
with:
certificate-data: ${{ secrets.APPLE_CERTIFICATE_DATA }}
certificate-passphrase: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
keychain-password: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }}
if: |
github.repository_owner == 'wpilibsuite' &&
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
- run: ./gradlew copyToUpload -Prunmerge -PdeveloperID=${{ secrets.APPLE_DEVELOPER_ID }}
name: Sign Binaries with Developer ID
if: |
github.repository_owner == 'wpilibsuite' &&
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
- uses: actions/upload-artifact@v3
with:
name: macOSUniversal
path: build/toUpload/
combine:
name: Combine
needs: [build-docker, build-windows, make_universal]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
repository: wpilibsuite/build-tools
- uses: actions/download-artifact@v3
with:
path: combiner/products/build/allOutputs
- name: Flatten Artifacts
run: rsync -a --delete combiner/products/build/allOutputs/*/* combiner/products/build/allOutputs/
- name: Combine
if: |
!startsWith(github.ref, 'refs/tags/v')
run: ./gradlew publish -Pthirdparty
working-directory: combiner
- name: Combine (Release)
if: |
github.repository_owner == 'wpilibsuite' &&
startsWith(github.ref, 'refs/tags/v')
run: |
./gradlew publish -Pthirdparty
working-directory: combiner
env:
RUN_AZURE_ARTIFACTORY_RELEASE: 'TRUE'
ARTIFACTORY_PUBLISH_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PUBLISH_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
- uses: actions/upload-artifact@v3
with:
name: Maven
path: ~/releases