-
Notifications
You must be signed in to change notification settings - Fork 47
149 lines (139 loc) · 8.6 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
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
name: Build
on:
push:
release:
types: [published]
jobs:
athena:
name: Build for Athena
runs-on: ubuntu-22.04
steps:
# Job setup & initial build
- name: "Checkout repository"
uses: actions/checkout@v3
- name: "Setup Java"
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "11"
- name: "Build all"
run: bazelisk build --config=athena --verbose_failures ...
- name: "Release: Get version number"
id: get_version
if: github.event_name == 'release'
uses: battila7/get-version-action@v2
- name: "Release: Get release info"
id: get_release_info
if: github.event_name == 'release'
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload vendordep
- name: "Release: Generate vendordep"
if: github.event_name == 'release'
run: bazelisk build --define "publishing_version=${{ steps.get_version.outputs.version-without-v }}" //:vendordep
- name: "Release: Upload vendordep"
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: bazel-bin/AdvantageKit.json
asset_name: AdvantageKit.json
asset_content_type: application/json
# Upload example projects
- name: "Release: Generate example projects"
if: github.event_name == 'release'
run: bazelisk build --define "publishing_version=${{ steps.get_version.outputs.version-without-v }}" //example_projects
- name: "Release: Upload example project (skeleton)"
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: bazel-bin/example_projects/skeleton.zip
asset_name: AdvantageKit_SkeletonProject.zip
asset_content_type: application/zip
- name: "Release: Upload example project (command)"
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: bazel-bin/example_projects/command.zip
asset_name: AdvantageKit_CommandBasedProject.zip
asset_content_type: application/zip
# Upload conduit build
- name: 'Release: Install Dependencies'
if: github.event_name == 'release'
run: pip3 install requests
- name: 'Release: Build "conduit/wpilibio:nativezip"'
if: github.event_name == 'release'
run: bazelisk build --config=athena --define "publishing_version=${{ steps.get_version.outputs.version-without-v }}" //conduit/wpilibio:nativezip
- name: 'Release: Upload "conduit/wpilibio:nativezip"'
if: github.event_name == 'release'
run: python3 build_tools/repo/publish_zip.py --url https://maven.pkg.github.com/Mechanical-Advantage/AdvantageKit --group_id org.littletonrobotics.akit.conduit --artifact_id conduit-wpilibio --version ${{ steps.get_version.outputs.version-without-v }} --classifier linuxathena --file_path bazel-bin/conduit/wpilibio/wpilibio-${{ steps.get_version.outputs.version-without-v }}-linuxathena.zip --username Mechanical-Advantage --access_token ${{ secrets.GITHUB_TOKEN }}
- name: 'Release: Upload "conduit/wpilibio:pom"'
if: github.event_name == 'release'
run: bazelisk run --config=athena --define "maven_repo=https://maven.pkg.github.com/Mechanical-Advantage/AdvantageKit" --define "publishing_version=${{ steps.get_version.outputs.version-without-v }}" //conduit/wpilibio:pom.publish
env:
GITHUB_ACTOR: Mechanical-Advantage
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Upload Java packages
- name: 'Release: Upload "conduit/api"'
if: github.event_name == 'release'
run: bazelisk run --define "maven_repo=https://maven.pkg.github.com/Mechanical-Advantage/AdvantageKit" --define "maven_user=Mechanical-Advantage" --define "maven_password=${{ secrets.GITHUB_TOKEN }}" --define "publishing_version=${{ steps.get_version.outputs.version-without-v }}" //conduit/api:api-export.publish
- name: 'Release: Upload "junction/core"'
if: github.event_name == 'release'
run: bazelisk run --define "maven_repo=https://maven.pkg.github.com/Mechanical-Advantage/AdvantageKit" --define "maven_user=Mechanical-Advantage" --define "maven_password=${{ secrets.GITHUB_TOKEN }}" --define "publishing_version=${{ steps.get_version.outputs.version-without-v }}" //junction/core:core-export.publish
- name: 'Release: Upload "junction/autolog"'
if: github.event_name == 'release'
run: bazelisk run --define "maven_repo=https://maven.pkg.github.com/Mechanical-Advantage/AdvantageKit" --define "maven_user=Mechanical-Advantage" --define "maven_password=${{ secrets.GITHUB_TOKEN }}" --define "publishing_version=${{ steps.get_version.outputs.version-without-v }}" //junction/autolog:autolog-export.publish
- name: 'Release: Upload "junction/shims/wpilib"'
if: github.event_name == 'release'
run: bazelisk run --define "maven_repo=https://maven.pkg.github.com/Mechanical-Advantage/AdvantageKit" --define "maven_user=Mechanical-Advantage" --define "maven_password=${{ secrets.GITHUB_TOKEN }}" --define "publishing_version=${{ steps.get_version.outputs.version-without-v }}" //junction/shims/wpilib:wpilib-export.publish
desktop:
strategy:
matrix:
host:
- { os: macos-latest, displayName: "macOS", classifier: "osxuniversal" }
- { os: ubuntu-22.04, displayName: "Linux", classifier: "linuxx86-64" }
- { os: windows-2019, displayName: "Windows", classifier: "windowsx86-64" }
name: Build for ${{ matrix.host.displayName }}
runs-on: ${{ matrix.host.os }}
steps:
# Job setup & initial build
- name: "Checkout repository"
uses: actions/checkout@v3
- name: "Setup Java"
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "11"
- name: "Build all"
run: bazelisk build --verbose_failures ...
- name: "Test all"
run: bazelisk test ...
- name: "Release: Get version number"
id: get_version
if: github.event_name == 'release'
uses: battila7/get-version-action@v2
# Upload conduit build
- name: 'Release: Install Dependencies'
if: github.event_name == 'release'
run: pip3 install requests
- name: 'Release: Build "conduit/wpilibio:nativezip" for macOS'
if: github.event_name == 'release' && matrix.host.displayName == 'macOS'
run: bazelisk build --define "publishing_version=${{ steps.get_version.outputs.version-without-v }}" //conduit/wpilibio/osxuniversal:nativezip
- name: 'Release: Upload "conduit/wpilibio:nativezip" for macOS'
if: github.event_name == 'release' && matrix.host.displayName == 'macOS'
run: python3 build_tools/repo/publish_zip.py --url https://maven.pkg.github.com/Mechanical-Advantage/AdvantageKit --group_id org.littletonrobotics.akit.conduit --artifact_id conduit-wpilibio --version ${{ steps.get_version.outputs.version-without-v }} --classifier ${{ matrix.host.classifier }} --file_path bazel-bin/conduit/wpilibio/osxuniversal/wpilibio-${{ steps.get_version.outputs.version-without-v }}-${{ matrix.host.classifier }}.zip --username Mechanical-Advantage --access_token ${{ secrets.GITHUB_TOKEN }}
- name: 'Release: Build "conduit/wpilibio:nativezip"'
if: github.event_name == 'release' && matrix.host.displayName != 'macOS'
run: bazelisk build --define "publishing_version=${{ steps.get_version.outputs.version-without-v }}" //conduit/wpilibio:nativezip
- name: 'Release: Upload "conduit/wpilibio:nativezip"'
if: github.event_name == 'release' && matrix.host.displayName != 'macOS'
run: python3 build_tools/repo/publish_zip.py --url https://maven.pkg.github.com/Mechanical-Advantage/AdvantageKit --group_id org.littletonrobotics.akit.conduit --artifact_id conduit-wpilibio --version ${{ steps.get_version.outputs.version-without-v }} --classifier ${{ matrix.host.classifier }} --file_path bazel-bin/conduit/wpilibio/wpilibio-${{ steps.get_version.outputs.version-without-v }}-${{ matrix.host.classifier }}.zip --username Mechanical-Advantage --access_token ${{ secrets.GITHUB_TOKEN }}