Skip to content

Commit d9e3b05

Browse files
committed
chore: automatically release to Maven Central
1 parent 8ad3c12 commit d9e3b05

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

.github/workflows/prerelease.yaml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,30 @@ 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:
143157
needs: build_release

0 commit comments

Comments
 (0)