-
Notifications
You must be signed in to change notification settings - Fork 68
62 lines (53 loc) · 1.53 KB
/
gradle-publish.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
name: Gradle Package 1.21
on:
workflow_dispatch:
push:
branches:
- "1.21"
paths:
- 'src/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: "1.21"
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'microsoft'
java-version: '21'
server-id: github
settings-path: ${{ github.workspace }}
- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build with Gradle
run: |
chmod +x ./gradlew
./gradlew build
- name: Create timestamp
id: create_timestamp
run: echo "::set-output name=timestamp::$(date '+%Y%m%d-%H%M%S')"
shell: bash
- name: Send file to Release
uses: softprops/action-gh-release@v2
with:
tag_name: snapshot-${{ steps.create_timestamp.outputs.timestamp }}
body: ${{ github.event.head_commit.message }}
draft: false
prerelease: true
files: |
./build/libs/*.jar
- name: Cleanup Gradle Cache
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties