-
Notifications
You must be signed in to change notification settings - Fork 17
66 lines (65 loc) · 2.18 KB
/
maven-deploy.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
name: Maven deploy
on:
workflow_call:
env:
JAVA_TOOL_OPTIONS: >-
-XX:TieredStopAtLevel=1
-XX:+UseParallelGC
jobs:
deploy:
name: Maven deploy
runs-on: ubuntu-20.04
if: github.repository == 'gantsign/ktlint-maven-plugin'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'temurin'
gpg-private-key: ${{ secrets.GPG_KEY }}
- name: Cache local Maven repository
uses: gantsign/maven-periodic-cache-action@v1
with:
key-suffix: '-deploy'
additional-path: '!~/.m2/repository/com/github/gantsign/maven'
- name: Configure maven settings.xml
shell: bash
run: |
mkdir -p ~/.m2
cat << 'EOF' > ~/.m2/settings.xml
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>ossrh</id>
<username>${env.OSSRH_USER}</username>
<password>${env.OSSRH_TOKEN}</password>
</server>
<server>
<id>github</id>
<username>${env.GITHUB_ACTOR}</username>
<password>${env.GITHUB_TOKEN}</password>
</server>
</servers>
</settings>
EOF
- name: Deploy with Maven
run: |
./mvnw deploy \
-P publish-artifacts,sign-artifacts,ossrh-deploy \
-DskipTests \
-Dinvoker.skip=true \
--batch-mode \
--show-version \
-Dstyle.color=always
env:
OSSRH_USER: ${{ secrets.OSSRH_USER }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}