-
Notifications
You must be signed in to change notification settings - Fork 25
144 lines (128 loc) · 4.79 KB
/
ci.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
name: CI
on: [ push, pull_request, workflow_dispatch ]
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
artifact-name: Linux
build-options: "-PlinuxBuild"
- os: ubuntu-22.04
artifact-name: LinuxArm64
build-options: "-PlinuxBuildArm64"
- os: macos-latest
artifact-name: macOS
build-options: "-PmacBuild"
- os: macos-latest
artifact-name: macOSArm
build-options: "-PmacBuildArm"
- os: windows-latest
artifact-name: Win64
build-options: ""
name: "Build - ${{ matrix.artifact-name }}"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@v3
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
- name: Import Developer ID Certificate
uses: wpilibsuite/import-signing-certificate@v2
with:
certificate-data: ${{ secrets.APPLE_CERTIFICATE_DATA }}
certificate-passphrase: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
keychain-password: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }}
if: |
(matrix.artifact-name == 'macOS' || matrix.artifact-name == 'macOSArm') &&
github.repository_owner == 'wpilibsuite' &&
(github.event_name == 'push' || github.event_name == 'workflow_dispatch')
- name: Set Keychain Lock Timeout
run: security set-keychain-settings -lut 2700
if: |
(matrix.artifact-name == 'macOS' || matrix.artifact-name == 'macOSArm') &&
github.repository_owner == 'wpilibsuite' &&
(github.event_name == 'push' || github.event_name == 'workflow_dispatch')
- name: Install roboRIO Toolchain
shell: bash
run: ./gradlew installRoboRioToolchain
- name: Build Installer (PR)
shell: bash
run: ./gradlew generateInstallers -PjenkinsBuild ${{ matrix.build-options }}
if: |
github.repository_owner != 'wpilibsuite' ||
(github.event_name != 'push' && github.event_name != 'workflow_dispatch')
- name: Build Installer (Main)
shell: bash
run: |
./gradlew generateInstallers -PjenkinsBuild ${{ matrix.build-options }} \
-PdeveloperID=${{ secrets.APPLE_DEVELOPER_ID }} \
-Pnotarization-username=${{ secrets.APPLE_NOTARIZATION_USERNAME }} \
-Pnotarization-teamid=${{ secrets.APPLE_NOTARIZATION_TEAMID }} \
-Pnotarization-password=${{ secrets.APPLE_NOTARIZATION_PASSWORD }}
if: |
github.repository_owner == 'wpilibsuite' &&
(github.event_name == 'push' || github.event_name == 'workflow_dispatch')
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}
path: build/pubOutputs/
release:
name: "Release"
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
- name: Print Checksums
run: |
md5sum **/*
sha256sum **/*
- uses: jfrog/setup-jfrog-cli@v2
if: |
github.repository_owner == 'wpilibsuite' &&
startsWith(github.ref, 'refs/tags/v')
env:
JF_ARTIFACTORY_1: ${{ secrets.ARTIFACTORY_CLI_SECRET }}
- name: Upload to Artifactory
if: |
github.repository_owner == 'wpilibsuite' &&
startsWith(github.ref, 'refs/tags/v')
run: jfrog rt u "**/*" "installer/${GITHUB_REF#refs/tags/}/"
- name: Setup Rclone
uses: AnimMouse/setup-rclone@v1
- name: Upload to Cloudflare
if: |
github.repository_owner == 'wpilibsuite' &&
startsWith(github.ref, 'refs/tags/v')
run: |
rclone copy "." "s3:wpilib1-enam/installer/${GITHUB_REF#refs/tags/}/"
env:
RCLONE_CONFIG_S3_TYPE: s3
RCLONE_CONFIG_S3_PROVIDER: Cloudflare
RCLONE_CONFIG_S3_ENDPOINT: ${{ secrets.CLOUDFLARE_ENDPOINT }}
RCLONE_CONFIG_S3_ACCESS_KEY_ID: ${{ secrets.CLOUDFLARE_ACCESS_KEY_ID }}
RCLONE_CONFIG_S3_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_SECRET_ACCESS_KEY }}
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install black
run: pip3 install black
- name: Run dotnet format
run: dotnet format
- name: Run black
run: black .
- name: Verify formatters made no changes
run: git --no-pager diff --exit-code HEAD