-
Notifications
You must be signed in to change notification settings - Fork 4
58 lines (47 loc) · 1.3 KB
/
gradle.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
name: 'Build'
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
jobs:
# Only if last commit does not contain [RELEASE]
check:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get Last Commit
run: |
$tmp = git show --pretty=format:"%s" -s HEAD
Write-Output "::set-env name=CommitMessage::$tmp"
shell: pwsh
- name: Check Last Commit
id: check_commit
run: |
if ($env:CommitMessage -match '\[RELEASE\]') {
echo "::set-output name=executable::true"
} else {
echo "::set-output name=executable::false"
}
shell: pwsh
outputs:
executable: ${{ steps.check_commit.outputs.executable }}
build:
runs-on: windows-latest
needs: check
if: ${{ needs.check.outputs.executable == 'false' }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '21'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build -x test