-
-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (73 loc) · 2.05 KB
/
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
83
84
85
86
name: Build & Upload Release jar with Gradle
on:
push:
branches:
- 'main'
- 'master'
tags:
- '*'
pull_request:
branches:
- 'main'
- 'master'
schedule:
- cron: '0 0 * * 6'
workflow_dispatch:
concurrency:
group: ${{ format('{0}-{1}', github.job, github.ref) }}
cancel-in-progress: true
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
java: [ 17 ]
if: github.ref_type != 'tag'
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Gradle
uses: ./.github/actions/gradle
- name: Setup JDK
uses: ./.github/actions/jdk
with:
java-version: ${{ matrix.java }}
- name: Build with Gradle
run: ./gradlew clean build --info
- name: Upload build results
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }} Java ${{ matrix.java }} Snapshot
path: ${{ github.workspace }}/build/libs/
release:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 17 ]
if: github.ref_type == 'tag'
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Gradle
uses: ./.github/actions/gradle
- name: Setup JDK
uses: ./.github/actions/jdk
with:
java-version: ${{ matrix.java }}
- name: Set Release Environment Variable
if: github.ref_type == 'tag'
run: |
echo "CUSTOM_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Build with Gradle
run: ./gradlew clean build -PcustomVersion=${{ env.CUSTOM_VERSION }}
- name: Create Release
uses: softprops/action-gh-release@v1
id: release
with:
name: ${{ format('Release {0}', github.ref_name) }}
files: ${{ github.workspace }}/build/libs/*
prerelease: ${{ contains(github.ref_name, '-RC-') }}
generate_release_notes: true
fail_on_unmatched_files: true
draft: false