-
Notifications
You must be signed in to change notification settings - Fork 25
127 lines (110 loc) · 4.04 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
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: 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@v3
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.100
- uses: actions/setup-java@v3
with:
java-version: 11
distribution: temurin
- 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: |
(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-password=${{ secrets.APPLE_NOTARIZATION_PASSWORD }}
if: |
github.repository_owner == 'wpilibsuite' &&
(github.event_name == 'push' || github.event_name == 'workflow_dispatch')
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.artifact-name }}
path: build/pubOutputs/
release:
name: "Release"
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
- name: Print Checksums
run: |
md5sum **/*
sha256sum **/*
- name: Upload to GitHub wpilibsuite/allwpilib
if: |
github.repository_owner == 'wpilibsuite' &&
startsWith(github.ref, 'refs/tags/v')
run: |
if ( gh -R wpilibsuite/allwpilib release view "${GITHUB_REF#refs/tags/}" 1> /dev/null ) ; then
gh -R wpilibsuite/allwpilib release upload --clobber "${GITHUB_REF#refs/tags/}" **/*
else
gh -R wpilibsuite/allwpilib release create -d "${GITHUB_REF#refs/tags/}" **/*
fi
env:
GITHUB_TOKEN: ${{secrets.GH_ADMIN_TOKEN}}
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.100
- uses: actions/setup-python@v4
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