-
Notifications
You must be signed in to change notification settings - Fork 28
104 lines (88 loc) · 3.42 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
name: CI
on: [push, pull_request]
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
artifact-name: Win64
architecture: x64
- os: macos-latest
artifact-name: macOS
architecture: x64
- os: ubuntu-latest
artifact-name: Linux
architecture: x64
name: "Build - ${{ matrix.artifact-name }}"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'zulu'
architecture: ${{ matrix.architecture }}
- 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') && (github.repository_owner == 'wpilibsuite') &&
(startsWith(github.ref, 'refs/heads/') || startsWith(github.ref, 'refs/tags/v'))
- name: Build with Gradle
run: ./gradlew build -PbuildServer -PdeveloperID=${{ secrets.APPLE_DEVELOPER_ID }}
if: ${{ !github.repository_owner == 'wpilibsuite' || !startsWith(github.ref, 'refs/tags/v') }}
- name: Build with Gradle (Release)
run: ./gradlew build -PbuildServer -PreleaseMode -PdeveloperID=${{ secrets.APPLE_DEVELOPER_ID }}
if: ${{ github.repository_owner == 'wpilibsuite' && startsWith(github.ref, 'refs/tags/v') }}
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.artifact-name }}
path: build/allOutputs
combine:
runs-on: ubuntu-latest
needs: build
name: "Combine"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'zulu'
- uses: actions/download-artifact@v3
with:
path: build/allOutputs
- name: Flatten Artifacts
run: |
rsync -a --delete --remove-source-files build/allOutputs/*/* build/allOutputs
find build/allOutputs -type d -empty -delete
- name: Combine (PR)
run: ./gradlew publish -PbuildServer -PprCombinePublish
if: |
(github.repository_owner != 'wpilibsuite') ||
(github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/v'))
- name: Combine (Master)
run: ./gradlew publish -PbuildServer
if: ${{ github.repository_owner == 'wpilibsuite' && github.ref == 'refs/heads/main' }}
env:
RUN_AZURE_ARTIFACTORY_RELEASE: 'TRUE'
ARTIFACTORY_PUBLISH_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PUBLISH_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
- name: Combine (Release)
run: ./gradlew publish -PbuildServer -PreleaseMode
if: ${{ github.repository_owner == 'wpilibsuite' && startsWith(github.ref, 'refs/tags/v') }}
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