更新脚本

This commit is contained in:
smallchill 2024-06-12 13:51:24 +08:00
parent 7cc4f67b51
commit aca498cef1
3 changed files with 48 additions and 4 deletions

32
.github/workflows/publish-snapshot.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: Publish Snapshot
on:
push:
branches: [ dev ]
pull_request:
branches: [ dev ]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
cache: 'maven'
java-version: 17
server-id: oss
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-passphrase: MAVEN_GPG_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
- name: Publish to the Maven Central Repository
run: |
chmod +x ./deploy.sh
./deploy.sh
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSWORD: ${{ secrets.MAVEN_GPG_PASSWORD }}

View File

@ -2,16 +2,16 @@ name: Java CI
on: [push, pull_request]
jobs:
buildOnJava8:
name: build on java8
buildOnJava17:
name: build on java17
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
cache: 'maven'
java-version: 8
java-version: 17
- name: Build with Maven
run: mvn package

12
deploy.sh Normal file
View File

@ -0,0 +1,12 @@
#!/bin/sh
## 1. java version
java -version
printf "\n"
## 2. mvn version
mvn -version
printf "\n"
## 3. deploy
mvn clean package deploy -Prelease