-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (40 loc) · 1.31 KB
/
publish-release-auto.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
name: Publish release (Auto)
on:
pull_request:
branches:
- master
types: [ closed ]
jobs:
publish-release:
if: ${{ github.event.pull_request.merged && !contains( github.event.pull_request.labels.*.name, 'norelease') }}
runs-on: ubuntu-latest
steps:
- name: Checkout latest code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 11
- name: Get Previous tag
id: previoustag
uses: WyriHaximus/github-action-get-previous-tag@v1
- name: Bump release version
id: bump_version
uses: christian-draeger/[email protected]
with:
current-version: ${{ steps.previoustag.outputs.tag }}
version-fragment: 'feature'
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.bump_version.outputs.next-version }}
generate_release_notes: true
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Publish package
run: ./gradlew -Pversion=${{ steps.bump_version.outputs.next-version }} publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}