forked from spotify-web-api-java/spotify-web-api-java
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (66 loc) · 2.04 KB
/
Copy pathci.yml
File metadata and controls
68 lines (66 loc) · 2.04 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: CI
on:
pull_request:
push:
branches:
- alpha
- beta
- master
- renovate/**
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
prepare_jobs:
name: "Prepare: job optimization"
runs-on: ubuntu-latest
outputs:
pr_found: ${{ steps.pr.outputs.pr_found }}
steps:
- name: Get current PR
id: pr
uses: 8BitJonny/gh-get-current-pr@2.2.0
with:
filterOutClosed: true
sha: ${{ github.event.pull_request.head.sha }}
build:
name: Build
needs: prepare_jobs
if: needs.prepare_jobs.outputs.pr_found == 'false' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
strategy:
matrix:
java: ["11", "21"]
steps:
- name: Checkout git repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0 # fetch complete history to find the last git tag
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: "adopt"
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Upload code coverage
uses: codecov/codecov-action@v4.0.0-beta.2
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Release
if: startsWith(github.ref, 'refs/tags/') && matrix.java == 11
env:
GPG_KEY_NAME: B70E1EAC
GPG_PASSPHRASE_KEY: ${{ secrets.GPG_PASSPHRASE_KEY }}
GPG_PASSPHRASE_FILE: ${{ secrets.GPG_PASSPHRASE_FILE }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
run: |
./ci/before-deploy.sh
cp ./ci/.m2.settings.xml $HOME/.m2/settings.xml
mvn deploy -P release -DskipTests=true
- name: Create release
if: startsWith(github.ref, 'refs/tags/') && matrix.java == 11
run: npx changelogithub
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}