-
Notifications
You must be signed in to change notification settings - Fork 8
82 lines (70 loc) · 2.55 KB
/
publish-release.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: Publish Release
on:
release:
types: [ published ]
branches: [ main ]
workflow_dispatch:
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.PAT }}
- name: Get Previous tag
id: previous_tag
uses: WyriHaximus/github-action-get-previous-tag@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get next minor version
id: semvers
uses: WyriHaximus/github-action-next-semvers@v1
with:
version: ${{ steps.previous_tag.outputs.tag }}
- name: print semver
id: print_semver
run: |
echo "current: $CURRENT"
echo "next: $NEXT"
env:
CURRENT: ${{ steps.previous_tag.outputs.tag }}
NEXT: ${{ steps.semvers.outputs.minor }}
- name: Setup AdoptOpenJDK
uses: joschi/setup-jdk@v2
with:
java-version: '17'
- name: Sign and publish with Gradle
working-directory: ./
run: ./gradlew sign test publish -PreleaseVersion=${{ steps.previous_tag.outputs.tag }}
- name: Publish Test Report
uses: mikepenz/action-junit-report@v2
if: always() # always run even if the previous step fails
with:
report_paths: '**/build/test-results/test/TEST-*.xml'
- name: Update library version
working-directory: ./
run: ./gradlew updateVersion -Pnext=${{ steps.semvers.outputs.minor }}-SNAPSHOT
- name: Commit gradle.properties with updated library version
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Update version to ${{ steps.semvers.outputs.minor }}-SNAPSHOT
file_pattern: gradle.properties
branch: main
commit_user_name: version-control-bot
commit_user_email: [email protected]
commit_author: version-control-bot <[email protected]>
- name: Create new milestone
id: create_milestone
uses: WyriHaximus/github-action-create-milestone@v1
with:
title: ${{ steps.semvers.outputs.minor }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}