Skip to content

Commit 5465a1a

Browse files
committed
add github actions
1 parent 7eb5cb9 commit 5465a1a

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ko_fi: alexcheng1982
2+
github: alexcheng1982

.github/workflows/build.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Set up JDK
16+
uses: actions/setup-java@v3
17+
with:
18+
java-version: "21"
19+
distribution: "temurin"
20+
cache: maven
21+
- name: Build with Maven
22+
env:
23+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
24+
run: mvn --batch-mode --update-snapshots package

.github/workflows/publish.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Publish package to the Maven Central Repository
2+
on:
3+
release:
4+
types: [ created ]
5+
jobs:
6+
publish:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- name: Set up Maven Central Repository
11+
uses: actions/setup-java@v3
12+
with:
13+
java-version: '21'
14+
distribution: 'temurin'
15+
server-id: ossrh
16+
server-username: MAVEN_USERNAME
17+
server-password: MAVEN_PASSWORD
18+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
19+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
20+
- name: Publish package
21+
run: mvn --batch-mode deploy
22+
env:
23+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
24+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
25+
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
26+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

0 commit comments

Comments
 (0)