-
-
Notifications
You must be signed in to change notification settings - Fork 96
67 lines (65 loc) · 2.34 KB
/
maven.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
name: Maven build / deploy
on:
push:
branches: [ dev ]
tags:
- 'v*'
pull_request:
branches: [ dev ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up JDK 1.8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
- name: Import GPG secrets
if: ${{ !startsWith(github.ref, 'refs/pull') }}
run: |
echo $GPG_SECRET_KEYS | base64 --decode > gpg-private-key.txt
gpg --pinentry-mode loopback --import --batch gpg-private-key.txt
echo $GPG_OWNERTRUST | base64 --decode > gpg-ownertrust.txt
gpg --pinentry-mode loopback --import-ownertrust --batch gpg-ownertrust.txt
env:
GPG_SECRET_KEYS: ${{ secrets.GPG_SECRET_KEYS }}
GPG_OWNERTRUST: ${{ secrets.GPG_OWNERTRUST }}
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: mvn clean test -Pdebug -B -U -Dgpg.skip -Dmaven.javadoc.skip=true
- name: Deploy with Maven to OSSRH
if: ${{ !startsWith(github.ref, 'refs/pull') }}
run: mvn deploy --settings .maven.xml -B -U -Possrh
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Deploy with Maven to GitHub packages
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: mvn deploy --settings .maven.xml -B -U -Pgithub
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create release
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: ${{ github.ref }}
draft: true
prerelease: false
files: |
player/target/librespot-player-*.jar
api/target/librespot-api-*.jar