Skip to content

Commit 118fbef

Browse files
committed
chore: automatically deploy to Maven Central and create a GH release
1 parent 8ad3c12 commit 118fbef

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

.github/workflows/prerelease.yaml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494
path: _tmp/jazzer.jar
9595
if-no-files-found: error
9696

97-
maven_predeploy:
97+
maven_deploy:
9898
runs-on: ubuntu-22.04
9999
needs: merge_jars
100100

@@ -128,19 +128,34 @@ jobs:
128128
env:
129129
RELEASE_SIGNING_KEY_ID: ${{ secrets.RELEASE_SIGNING_KEY_ID }}
130130
RELEASE_SIGNING_KEY_PRIVATE: ${{ secrets.RELEASE_SIGNING_KEY_PRIVATE }}
131-
MAVEN_USER: ${{ secrets.MAVEN_USER }}
132-
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
133-
run: JAZZER_JAR_PATH="$(pwd)/_tmp/jazzer.jar" bazel run deploy
131+
run: |
132+
JAZZER_JAR_PATH="$(pwd)/_tmp/jazzer.jar" bazel run deploy
133+
cd _tmp
134+
tar -czvf jazzer-maven-central-bundle.tar.gz -C release com
134135
136+
# In case something goes wrong, we can still reupload the bundle manually
135137
- name: Upload Jazzer Bundle to Github Artifacts
136138
uses: actions/upload-artifact@v5
137139
with:
138140
name: jazzer-maven-central-bundle
139-
path: _tmp/release
141+
path: _tmp/jazzer-maven-central-bundle.tar.gz
140142
if-no-files-found: error
143+
# don't wrap .tar.gz in a .zip
144+
compression-level: 0
145+
146+
- name: Deploy to Maven Central
147+
shell: bash
148+
run: |
149+
TAG=${{ github.ref_name }}
150+
curl --request POST \
151+
--verbose \
152+
--fail-with-body \
153+
--header "Authorization: Bearer ${{ secrets.SONATYPE_BEARER_TOKEN }}" \
154+
--form bundle=@_tmp/jazzer-maven-central-bundle.tar.gz \
155+
"https://central.sonatype.com/api/v1/publisher/upload?name=Jazzer%20${TAG#v}&publishingType=AUTOMATIC"
141156
142157
create_release:
143-
needs: build_release
158+
needs: [build_release, maven_deploy]
144159
runs-on: ubuntu-24.04
145160

146161
permissions:
@@ -161,7 +176,6 @@ jobs:
161176
uses: softprops/action-gh-release@6da8fa9354ddfdc4aeace5fc48d7f679b5214090 # v2.4.1
162177
with:
163178
generate_release_notes: true
164-
draft: true
165179
files: |
166180
_releases/jazzer-linux-x86-64.tar.gz
167181
_releases/jazzer-linux-arm64.tar.gz

0 commit comments

Comments
 (0)