-
Notifications
You must be signed in to change notification settings - Fork 8
46 lines (44 loc) · 1.39 KB
/
maven-publish.yml
File metadata and controls
46 lines (44 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Auto Deploy jetlinks-sdk to the JetLinks Maven Repository
on:
push:
branches: ["master"]
jobs:
publish:
runs-on: ubuntu-latest
strategy:
matrix:
node_version: [ 18.x ]
# os: [ubuntu-latest, windows-latest, macOS-latest]
os: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v4
- run: echo ${{github.ref}}
- name: Set up Repository info
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Cache Maven Repository
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
- name: Create Maven settings.xml
#uses: actions/cache@v3
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
run: |
mkdir -p ~/.m2
echo "<settings>
<servers>
<server>
<id>snapshots</id>
<username>${MAVEN_USERNAME}</username>
<password>${MAVEN_PASSWORD}</password>
</server>
</servers>
</settings>" > ~/.m2/settings.xml
# Step 4: 构建并发布到 Maven 私有仓库
- name: Build and Deploy to Maven
run: mvn clean deploy