-
Notifications
You must be signed in to change notification settings - Fork 6
82 lines (78 loc) · 2.4 KB
/
main.yml
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Build & Deploy
on: [ push ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: Verify
run: mvn --batch-mode --update-snapshots verify
publish:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/master'
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: Remove -SNAPSHOT
run: mvn versions:set --batch-mode -DremoveSnapshot
- name: Publish package
run: mvn --batch-mode -P github deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
server-id: dyescape-libraries
server-username: DYESCAPE_SPACE_USERNAME
server-password: DYESCAPE_SPACE_PASSWORD
- name: Publish package
run: mvn --batch-mode -P internal deploy
env:
DYESCAPE_SPACE_USERNAME: ${{ secrets.DYESCAPE_SPACE_USERNAME }}
DYESCAPE_SPACE_PASSWORD: ${{ secrets.DYESCAPE_SPACE_PASSWORD }}
publish-snapshot:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/develop'
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: Publish package
run: mvn --batch-mode -P github deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
server-id: dyescape-libraries
server-username: DYESCAPE_SPACE_USERNAME
server-password: DYESCAPE_SPACE_PASSWORD
- name: Publish package (internal)
run: mvn --batch-mode -P internal deploy
env:
DYESCAPE_SPACE_USERNAME: ${{ secrets.DYESCAPE_SPACE_USERNAME }}
DYESCAPE_SPACE_PASSWORD: ${{ secrets.DYESCAPE_SPACE_PASSWORD }}