-
Notifications
You must be signed in to change notification settings - Fork 165
184 lines (156 loc) · 5.56 KB
/
prerelease.yaml
File metadata and controls
184 lines (156 loc) · 5.56 KB
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
name: Pre-Release
on:
workflow_dispatch:
push:
tags:
- 'v*'
jobs:
build_release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-22.04
name: linux-x86-64
- os: ubuntu-22.04-arm
name: linux-arm64
- os: macos-14
name: macos
- os: windows-2022
name: windows
steps:
- uses: actions/checkout@v6
- name: Set up JDK
uses: actions/setup-java@v5
with:
distribution: zulu
java-version: 21
- name: Install Clang on Windows
if: matrix.os == 'windows-2022'
run: |
choco install llvm --version=19.1.0 --force
echo "C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Append build settings to .bazelrc
shell: bash
run: |
TAG=${{ github.ref_name }}
echo "build --remote_header=x-buildbuddy-api-key=${{ secrets.BUILDBUDDY_API_KEY }}" >> .bazelrc
echo "build --config=ci" >> .bazelrc
echo "build --//deploy:jazzer_version=${TAG#v}" >> .bazelrc
- name: Build
shell: bash
# Double forward slashes are converted to single ones by Git Bash on Windows, so we use working directory
# relative labels instead.
run: |
bazelisk build ${{env.BUILD_BUDDY_CONFIG}} deploy:jazzer :jazzer_release
cp -L $(bazel cquery --output=files deploy:jazzer) jazzer-${{ matrix.name }}.jar
cp -L $(bazel cquery --output=files :jazzer_release) jazzer-${{ matrix.name }}.tar.gz
- name: Upload jazzer.jar
uses: actions/upload-artifact@v6
with:
name: jazzer_tmp_${{ matrix.name }}
path: jazzer-${{ matrix.name }}.jar
if-no-files-found: error
- name: Upload release archive
uses: actions/upload-artifact@v6
with:
name: jazzer_releases_${{ matrix.name }}
path: jazzer-${{ matrix.name }}.tar.gz
if-no-files-found: error
merge_jars:
runs-on: ubuntu-22.04
needs: build_release
steps:
- uses: actions/checkout@v6
- name: Download individual jars
uses: actions/download-artifact@v7
with:
pattern: jazzer_tmp_*
merge-multiple: true
path: _tmp/
- name: Merge jars
run: |
bazel run @rules_jvm_external//private/tools/java/com/github/bazelbuild/rules_jvm_external/jar:MergeJars -- \
--output "$(pwd)"/_tmp/jazzer.jar \
$(find "$(pwd)/_tmp/" -name '*.jar' -printf "--sources %h/%f ")
- name: Upload merged jar
uses: actions/upload-artifact@v6
with:
name: jazzer
path: _tmp/jazzer.jar
if-no-files-found: error
maven_deploy:
runs-on: ubuntu-22.04
needs: merge_jars
environment:
name: Deploy
steps:
- uses: actions/checkout@v6
- name: Set up JDK
uses: actions/setup-java@v5
with:
distribution: zulu
java-version: 8
- name: Append build settings to .bazelrc
shell: bash
run: |
TAG=${{ github.ref_name }}
echo "build --remote_header=x-buildbuddy-api-key=${{ secrets.BUILDBUDDY_API_KEY }}" >> .bazelrc
echo "build --config=ci" >> .bazelrc
echo "build --//deploy:jazzer_version=${TAG#v}" >> .bazelrc
- name: Download merged jar
uses: actions/download-artifact@v7
with:
name: jazzer
path: _tmp/
- name: Generate Jazzer Bundle for Upload to Maven Central
env:
RELEASE_SIGNING_KEY_ID: ${{ secrets.RELEASE_SIGNING_KEY_ID }}
RELEASE_SIGNING_KEY_PRIVATE: ${{ secrets.RELEASE_SIGNING_KEY_PRIVATE }}
run: |
JAZZER_JAR_PATH="$(pwd)/_tmp/jazzer.jar" bazel run deploy
cd _tmp
tar -czvf jazzer-maven-central-bundle.tar.gz -C release com
# In case something goes wrong, we can still reupload the bundle manually
- name: Upload Jazzer Bundle to Github Artifacts
uses: actions/upload-artifact@v6
with:
name: jazzer-maven-central-bundle
path: _tmp/jazzer-maven-central-bundle.tar.gz
if-no-files-found: error
# don't wrap .tar.gz in a .zip
compression-level: 0
- name: Deploy to Maven Central
shell: bash
run: |
TAG=${{ github.ref_name }}
curl --request POST \
--verbose \
--fail-with-body \
--header "Authorization: Bearer ${{ secrets.SONATYPE_BEARER_TOKEN }}" \
--form bundle=@_tmp/jazzer-maven-central-bundle.tar.gz \
"https://central.sonatype.com/api/v1/publisher/upload?name=Jazzer%20${TAG#v}&publishingType=AUTOMATIC"
create_release:
needs: build_release
runs-on: ubuntu-24.04
permissions:
contents: write # for creating releases
steps:
- name: checkout
uses: actions/checkout@v6
- name: Download individual tar.gzs
uses: actions/download-artifact@v7
with:
pattern: jazzer_releases_*
merge-multiple: true
path: _releases/
- name: create release
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
with:
generate_release_notes: true
draft: true
files: |
_releases/jazzer-linux-x86-64.tar.gz
_releases/jazzer-linux-arm64.tar.gz
_releases/jazzer-macos.tar.gz
_releases/jazzer-windows.tar.gz