mirror of
https://gitee.com/fujieid/jap.git
synced 2024-12-02 03:17:33 +08:00
Merge pull request #15 from kang8/dev
fix PR bug and refactory publish snapshot
This commit is contained in:
commit
33145b7a19
42
.github/workflows/publish-snapshot.yml
vendored
42
.github/workflows/publish-snapshot.yml
vendored
@ -4,32 +4,46 @@
|
||||
name: Publish Snapshot
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [ dev ]
|
||||
paths:
|
||||
- src/**
|
||||
- pom.xml
|
||||
pull_request:
|
||||
branches: [ dev ]
|
||||
paths:
|
||||
- src/**
|
||||
- pom.xml
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2.2.0
|
||||
|
||||
- name: Set up Java and Maven
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: '8'
|
||||
distribution: 'adopt'
|
||||
|
||||
- name: Cache m2 package
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
|
||||
- run: mvn test
|
||||
|
||||
publish:
|
||||
needs: test
|
||||
if: ${{ success() }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK 1.8
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 1.8
|
||||
|
||||
- name: Set up Apache Maven Central
|
||||
uses: actions/setup-java@v1
|
||||
- name: Set up Java and Maven
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: 1.8
|
||||
java-version: '8'
|
||||
distribution: 'adopt'
|
||||
server-id: sonatype-nexus-snapshots
|
||||
server-username: MAVEN_USERNAME
|
||||
server-password: MAVEN_PASSWORD
|
||||
@ -52,7 +66,7 @@ jobs:
|
||||
run: mvn versions:set -DnewVersion=${{ env.VERSION }}-SNAPSHOT
|
||||
|
||||
- name: deploy snapshot to oss repository
|
||||
run: mvn clean deploy -P release
|
||||
run: mvn -B deploy -P release -DskipTests
|
||||
env:
|
||||
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
|
||||
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
|
||||
|
25
.github/workflows/test-pr.yml
vendored
Normal file
25
.github/workflows/test-pr.yml
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
name: test pull_request
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- src/**
|
||||
- pom.xml
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2.2.0
|
||||
- name: Set up Java and Maven
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: '8'
|
||||
- name: Cache m2 package
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
- run: mvn test
|
Loading…
Reference in New Issue
Block a user