Skip to content

Commit c6b4e6a

Browse files
committed
refactor(基础模块): 优化CI
1 parent 68b2764 commit c6b4e6a

File tree

2 files changed

+47
-1
lines changed

2 files changed

+47
-1
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Auto Deploy 4.2 to the Maven Repository
2+
on:
3+
push:
4+
branches:
5+
- "4.2"
6+
jobs:
7+
publish:
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
node_version: [ 18.x ]
12+
# os: [ubuntu-latest, windows-latest, macOS-latest]
13+
os: [ ubuntu-latest ]
14+
steps:
15+
- uses: actions/checkout@v1
16+
- run: echo ${{github.ref}}
17+
- name: Set up Repository info
18+
uses: actions/setup-java@v2
19+
with:
20+
java-version: '17'
21+
distribution: 'adopt'
22+
- name: Cache Maven Repository
23+
uses: actions/cache@v3
24+
with:
25+
path: ~/.m2
26+
key: ${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
27+
- name: Create Maven settings.xml
28+
#uses: actions/cache@v3
29+
env:
30+
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
31+
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
32+
run: |
33+
mkdir -p ~/.m2
34+
echo "<settings>
35+
<servers>
36+
<server>
37+
<id>snapshots</id>
38+
<username>${MAVEN_USERNAME}</username>
39+
<password>${MAVEN_PASSWORD}</password>
40+
</server>
41+
</servers>
42+
</settings>" > ~/.m2/settings.xml
43+
44+
# Step 4: 构建并发布到 Maven 私有仓库
45+
- name: Build and Deploy to Maven
46+
run: mvn clean deploy -q -pl "$(./changes.sh)"

.github/workflows/unit-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
name: Java CI with Maven
55

6-
on: [push]
6+
on: [pull_request]
77

88
jobs:
99
build:

0 commit comments

Comments
 (0)