-
Notifications
You must be signed in to change notification settings - Fork 36
53 lines (43 loc) · 1.61 KB
/
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
name: Deploy
on:
push:
tags:
- '*.*.*'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 8
- name: Build
run: ./gradlew build
- name: Get tag and tracker version information
id: version
run: |
echo ::set-output name=TAG_VERSION::${GITHUB_REF#refs/*/}
echo "##[set-output name=TRACKER_VERSION;]$(./gradlew -q printVersion)"
- name: Fail if version mismatch
if: ${{ steps.version.outputs.TAG_VERSION != steps.version.outputs.TRACKER_VERSION }}
run: |
echo "Tag version (${{ steps.version.outputs.TAG_VERSION }}) doesn't match version in project (${{ steps.version.outputs.TRACKER_VERSION }})"
exit 1
- name: Publish to Maven Central
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
env:
SONA_USER: ${{ secrets.SONA_USER }}
SONA_PASS: ${{ secrets.SONA_PASS }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SONA_PGP_PASSPHRASE }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SONA_PGP_SECRET }}
- name: Release on GitHub
uses: softprops/action-gh-release@v1
with:
name: Version ${{ steps.version.outputs.TRACKER_VERSION }}
prerelease: ${{ contains(steps.version.outputs.TRACKER_VERSION, '-') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}