-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (48 loc) · 1.66 KB
/
autoMainRelease.yml
File metadata and controls
58 lines (48 loc) · 1.66 KB
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: Main Auto Release
on:
push:
branches:
- main
- v7-main
workflow_call:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Set up PATH
run: echo "${ANDROID_HOME}/build-tools/34.0.0" >> $GITHUB_PATH
- name: Setup Hjson
run: npm install hjson -g
- name: Convert mod.hjson to mod.json
run: hjson -j mod.hjson > mod.json
- name: Get Version
id: version
uses: notiz-dev/github-action-json-property@release
with:
path: 'mod.json'
prop_path: 'version'
- name: Convert mod.json back to mod.hjson
run: hjson mod.json > mod.hjson
- name: Change wrapper permissions
run: chmod +x ./gradlew
- name: Build mod jar
run: ./gradlew deploy
- name: Release rename
run:
mv build/libs/${{ github.event.repository.name }}.jar build/libs/${{ github.event.repository.name }}-${{ steps.version.outputs.prop }}.jar
- name: Upload built jar file
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}-${{ steps.version.outputs.prop }}
path: build/libs/${{ github.event.repository.name }}-${{ steps.version.outputs.prop }}.jar
- name: Create release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/libs/${{ github.event.repository.name }}-${{ steps.version.outputs.prop }}.jar
tag: ${{ steps.version.outputs.prop }}