Skip to content

Commit dc8f4c7

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

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

.github/workflows/prerelease.yaml

Lines changed: 20 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,33 @@ 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 the something goes wrong, we can still re/upload 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+
--header "Authorization: Bearer ${{ secrets.SONATYPE_BEARER_TOKEN }}" \
153+
--form bundle=@_tmp/jazzer-maven-central-bundle.tar.gz \
154+
"https://central.sonatype.com/api/v1/publisher/upload?name=Jazzer%20${TAG#v}&publishingType=AUTOMATIC"
141155
142156
create_release:
143-
needs: build_release
157+
needs: [build_release, maven_deploy]
144158
runs-on: ubuntu-24.04
145159

146160
permissions:
@@ -161,7 +175,6 @@ jobs:
161175
uses: softprops/action-gh-release@6da8fa9354ddfdc4aeace5fc48d7f679b5214090 # v2.4.1
162176
with:
163177
generate_release_notes: true
164-
draft: true
165178
files: |
166179
_releases/jazzer-linux-x86-64.tar.gz
167180
_releases/jazzer-linux-arm64.tar.gz

0 commit comments

Comments
 (0)