Skip to content

Commit 3f571f3

Browse files
committed
feat(ci): add a workflow to publish snapshot
1 parent ab80272 commit 3f571f3

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/snapshot.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish a snapshot package to Maven Central
2+
3+
on: workflow_dispatch
4+
5+
jobs:
6+
publish:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
contents: read
10+
packages: write
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Set up JDK
14+
uses: actions/setup-java@v4
15+
with:
16+
java-version: '17'
17+
distribution: 'adopt'
18+
- name: Setup git config (for patch command)
19+
run: |
20+
git config --global user.name "GitHub Actions Bot"
21+
git config --global user.email "<>"
22+
- name: Grant execute permission for gradlew
23+
run: chmod +x gradlew
24+
- name: Publish package
25+
run: ./gradlew publish
26+
env:
27+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
28+
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
29+
GPG_KEY: ${{ secrets.GPG_KEY }}
30+
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
31+
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}

0 commit comments

Comments
 (0)