-
Notifications
You must be signed in to change notification settings - Fork 2
190 lines (188 loc) · 8.96 KB
/
release.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
name: Release
on:
push:
branches:
- main
jobs:
rust-binaries:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [macos-latest, ubuntu-20.04]
include:
- os: macos-latest
platform: macos
artifact: bazelfe-macos
- os: ubuntu-20.04
platform: linux-ubuntu-20.04
artifact: bazelfe-linux-ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
version: "23.x"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- run: rustup component add rustfmt
# Handle the Linux MUSL cases
- if: ${{ runner.os == 'Linux' }}
uses: awalsh128/cache-apt-pkgs-action@v1
with:
packages: musl-tools # provides musl-gcc
version: 1.0
- if: ${{ runner.os == 'Linux' }}
run: rustup target add x86_64-unknown-linux-musl
- if: ${{ runner.os == 'Linux' }}
uses: actions-rs/cargo@v1
with:
command: build
args: --release --target=x86_64-unknown-linux-musl
- name: Prepare bazel-runner output
run: ./.github/ci_scripts/prepare_output.sh bazel-runner-${{ matrix.platform }} staging-directory target/x86_64-unknown-linux-musl/release/bazel-runner
if: ${{ runner.os == 'Linux' }}
- name: Prepare jvm-indexer
run: ./.github/ci_scripts/prepare_output.sh jvm-indexer-${{ matrix.platform }} staging-directory target/x86_64-unknown-linux-musl/release/jvm-indexer
if: ${{ runner.os == 'Linux' }}
- name: Prepare bep-junit
run: ./.github/ci_scripts/prepare_output.sh bep-junit-${{ matrix.platform }} staging-directory target/x86_64-unknown-linux-musl/release/bep-junit
if: ${{ runner.os == 'Linux' }}
- if: ${{ runner.os == 'Linux' }}
uses: actions-rs/cargo@v1
with:
command: build
args: --release --all-features --target=x86_64-unknown-linux-musl
- name: Prepare bazel-runner-with-daemon output
run: ./.github/ci_scripts/prepare_output.sh bazel-runner-with-daemon-${{ matrix.platform }} staging-directory target/x86_64-unknown-linux-musl/release/bazel-runner
if: ${{ runner.os == 'Linux' }}
- name: Prepare jvm-indexer-with-daemon
run: ./.github/ci_scripts/prepare_output.sh jvm-indexer-with-daemon-${{ matrix.platform }} staging-directory target/x86_64-unknown-linux-musl/release/jvm-indexer
if: ${{ runner.os == 'Linux' }}
- name: Prepare bep-junit-with-daemon
run: ./.github/ci_scripts/prepare_output.sh bep-junit-with-daemon-${{ matrix.platform }} staging-directory target/x86_64-unknown-linux-musl/release/bep-junit
if: ${{ runner.os == 'Linux' }}
# Handle the non-Linux cases
- if: ${{ runner.os != 'Linux' }}
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Prepare bazel-runner output (not Linux)
run: ./.github/ci_scripts/prepare_output.sh bazel-runner-${{ matrix.platform }} staging-directory target/release/bazel-runner
if: ${{ runner.os != 'Linux' }}
- name: Prepare jvm-indexer (not Linux)
run: ./.github/ci_scripts/prepare_output.sh jvm-indexer-${{ matrix.platform }} staging-directory target/release/jvm-indexer
if: ${{ runner.os != 'Linux' }}
- name: Prepare bep-junit (not Linux)
run: ./.github/ci_scripts/prepare_output.sh bep-junit-${{ matrix.platform }} staging-directory target/release/bep-junit
if: ${{ runner.os != 'Linux' }}
- if: ${{ runner.os != 'Linux' }}
uses: actions-rs/cargo@v1
with:
command: build
args: --release --all-features
- name: Prepare bazel-runner-with-daemon output (not Linux)
run: ./.github/ci_scripts/prepare_output.sh bazel-runner-with-daemon-${{ matrix.platform }} staging-directory target/release/bazel-runner
if: ${{ runner.os != 'Linux' }}
- name: Prepare jvm-indexer-with-daemon (not Linux)
run: ./.github/ci_scripts/prepare_output.sh jvm-indexer-with-daemon-${{ matrix.platform }} staging-directory target/release/jvm-indexer
if: ${{ runner.os != 'Linux' }}
- name: Prepare bep-junit-with-daemon (not Linux)
run: ./.github/ci_scripts/prepare_output.sh bep-junit-with-daemon-${{ matrix.platform }} staging-directory target/release/bep-junit
if: ${{ runner.os != 'Linux' }}
- uses: actions/upload-artifact@master
with:
name: ${{ matrix.artifact }}
path: staging-directory
rust-crossbuild-macos-arm64:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
version: "23.x"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- run: rustup component add rustfmt
- run: rustup target add aarch64-apple-darwin
- run: SDKROOT=$(xcrun -sdk macosx --show-sdk-path) MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx --show-sdk-platform-version) cargo build --target=aarch64-apple-darwin --release
- name: Prepare bazel-runner output
run: ./.github/ci_scripts/prepare_output.sh bazel-runner-macos-arm64 staging-directory target/aarch64-apple-darwin/release/bazel-runner
- name: Prepare jvm-indexer
run: ./.github/ci_scripts/prepare_output.sh jvm-indexer-macos-arm64 staging-directory target/aarch64-apple-darwin/release/jvm-indexer
- name: Prepare bep-junit
run: ./.github/ci_scripts/prepare_output.sh bep-junit-macos-arm64 staging-directory target/aarch64-apple-darwin/release/bep-junit
- run: SDKROOT=$(xcrun -sdk macosx --show-sdk-path) MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx --show-sdk-platform-version) cargo build --target=aarch64-apple-darwin --release --all-features
- name: Prepare bazel-runner output
run: ./.github/ci_scripts/prepare_output.sh bazel-runner-with-daemon-macos-arm64 staging-directory target/aarch64-apple-darwin/release/bazel-runner
- name: Prepare jvm-indexer
run: ./.github/ci_scripts/prepare_output.sh jvm-indexer-with-daemon-macos-arm64 staging-directory target/aarch64-apple-darwin/release/jvm-indexer
- name: Prepare bep-junit
run: ./.github/ci_scripts/prepare_output.sh bep-junit-with-daemon-macos-arm64 staging-directory target/aarch64-apple-darwin/release/bep-junit
- uses: actions/upload-artifact@master
with:
name: bazelfe-macos-arm64
path: staging-directory
make_release:
name: Make release
needs: [rust-binaries, rust-crossbuild-macos-arm64]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Download linux ubuntu 20 bazelfe
uses: actions/download-artifact@v4
with:
name: bazelfe-linux-ubuntu-20.04
path: downloads
- name: Download macos bazelfe
uses: actions/download-artifact@v4
with:
name: bazelfe-macos
path: downloads
- name: Download macos arm64 bazelfe
uses: actions/download-artifact@v4
with:
name: bazelfe-macos-arm64
path: downloads
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "v0.1-${{ github.run_number }}"
prerelease: false
title: "Auto generated release for bazel-runner"
files: |
downloads/bazel-runner-macos
downloads/bazel-runner-macos.sha256
downloads/bazel-runner-with-daemon-macos
downloads/bazel-runner-with-daemon-macos.sha256
downloads/bazel-runner-macos-arm64
downloads/bazel-runner-macos-arm64.sha256
downloads/bazel-runner-with-daemon-macos-arm64
downloads/bazel-runner-with-daemon-macos-arm64.sha256
downloads/bazel-runner-linux-ubuntu-20.04
downloads/bazel-runner-linux-ubuntu-20.04.sha256
downloads/bazel-runner-with-daemon-linux-ubuntu-20.04
downloads/bazel-runner-with-daemon-linux-ubuntu-20.04.sha256
downloads/jvm-indexer-macos
downloads/jvm-indexer-macos.sha256
downloads/jvm-indexer-macos-arm64
downloads/jvm-indexer-macos-arm64.sha256
downloads/jvm-indexer-linux-ubuntu-20.04
downloads/jvm-indexer-linux-ubuntu-20.04.sha256
downloads/bep-junit-macos
downloads/bep-junit-macos.sha256
downloads/bep-junit-macos-arm64
downloads/bep-junit-macos-arm64.sha256
downloads/bep-junit-linux-ubuntu-20.04
downloads/bep-junit-linux-ubuntu-20.04.sha256
id: "automatic_releases"