-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (37 loc) · 1.19 KB
/
release.yml
File metadata and controls
46 lines (37 loc) · 1.19 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
name: Release
on:
push:
tags:
- "v*"
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- uses: gradle/actions/setup-gradle@v4
- run: ./gradlew test
- run: ./gradlew spotlessCheck
- name: Publish to staging
run: ./gradlew publishAllPublicationsToStagingRepository
env:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_SIGNING_KEY }}
- name: Create bundle for Maven Central
run: |
cd build/staging-deploy
zip -r ../../bundle.zip .
- name: Publish to Maven Central
run: |
curl -s --fail \
-u "${{ secrets.CENTRAL_USERNAME }}:${{ secrets.CENTRAL_PASSWORD }}" \
-F "bundle=@bundle.zip" \
"https://central.sonatype.com/api/v1/publisher/upload?publishingType=AUTOMATIC&name=dev.peekapi:peekapi:${{ github.ref_name }}"
- name: Create GitHub Release
run: gh release create "${{ github.ref_name }}" --generate-notes
env:
GH_TOKEN: ${{ github.token }}