-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (72 loc) · 2.21 KB
/
Copy pathrelease.yml
File metadata and controls
84 lines (72 loc) · 2.21 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
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
name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
- name: Determine Version
id: versioning
run: |
if [[ $GITHUB_REF == refs/tags/v* ]]; then
VERSION=${GITHUB_REF#refs/tags/v}
IS_RELEASE=true
else
COMMIT_COUNT=$(git rev-list --count HEAD)
VERSION="$COMMIT_COUNT"
IS_RELEASE=false
fi
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "IS_RELEASE=$IS_RELEASE" >> $GITHUB_OUTPUT
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "IS_RELEASE=$IS_RELEASE" >> $GITHUB_ENV
- name: Update Version in Properties
run: |
sed -i "s/version=INDEV/version=${{ steps.versioning.outputs.VERSION }}/" gradle.properties
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Build with Gradle
run: ./gradlew build shadowJar
- name: Create Release
if: steps.versioning.outputs.IS_RELEASE == 'true'
uses: softprops/action-gh-release@v2
with:
files: build/libs/Advance-*-all.jar
generate_release_notes: true
make_latest: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload build artifacts
if: steps.versioning.outputs.IS_RELEASE == 'false'
uses: actions/upload-artifact@v4
with:
name: Advance-${{ steps.versioning.outputs.VERSION }}
path: build/libs
- name: Publish to Modrinth
if: steps.versioning.outputs.IS_RELEASE == 'true'
uses: kir-antipov/mc-publish@v3.3
with:
modrinth-id: "ab7RsjrW"
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
files: build/libs/Advance-*-all.jar
name: Advance ${{ steps.versioning.outputs.VERSION }}
version: ${{ steps.versioning.outputs.VERSION }}
loaders: |
paper
folia
purpur
game-versions: |
1.21.x