-
Notifications
You must be signed in to change notification settings - Fork 33
68 lines (58 loc) · 2.04 KB
/
build.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
name: Build
on:
push:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/cache@v2
with:
path: |
~/.gradle/loom-cache
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
gradle-
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 21
- name: Read mod version from Gradle
id: read_version
uses: christian-draeger/read-properties@1.0.1
with:
path: './gradle.properties'
property: 'mod_version'
- name: Generate build number
uses: kNoAPP/gh-action-buildnum@7952ffa54bc2c37e2c33bbb3d7226473274cce3e
id: 'minor_version'
with:
workflow_name: 'minor_version'
version_key: ${{ steps.read_version.outputs.value }}
gist_token: ${{ secrets.GIST_TOKEN }}
skip_bump: true
- name: Generate build number
uses: kNoAPP/gh-action-buildnum@7952ffa54bc2c37e2c33bbb3d7226473274cce3e
id: 'build_number'
with:
workflow_name: 'build_number'
version_key: ${{ format('{0}.{1}', steps.read_version.outputs.value, steps.minor_version.outputs.version_build_number) }}
gist_token: ${{ secrets.GIST_TOKEN }}
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build and publish with Gradle
run: ./gradlew build publish
env:
MAVEN_URL: ${{ secrets.MAVEN_URL }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
GITHUB_ACTIONS: true
SNAPSHOT: true
MINOR_VERSION: ${{ steps.minor_version.outputs.version_build_number }}
BUILD_NUMBER: ${{ steps.build_number.outputs.version_build_number }}
- uses: actions/upload-artifact@v4
with:
name: artifacts
path: build/libs