-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (37 loc) · 1.22 KB
/
release.yml
File metadata and controls
45 lines (37 loc) · 1.22 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
name: Release
on:
workflow_dispatch:
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Read versions from gradle.properties
id: versions
run: |
MC=$(grep -E '^minecraft_version\s*=' gradle.properties \
| sed 's/.*=\s*//' | tr -d '[:space:]')
MOD=$(grep -E '^mod_version\s*=' gradle.properties \
| sed 's/.*=\s*//' | tr -d '[:space:]')
echo "mc=$MC" >> "$GITHUB_OUTPUT"
echo "mod=$MOD" >> "$GITHUB_OUTPUT"
- name: Setup JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Make Gradle wrapper executable
run: chmod +x ./gradlew
- name: Build
run: ./gradlew build
- name: Upload JAR to GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event_name == 'workflow_dispatch' && format('v{0}-{1}', steps.versions.outputs.mc, steps.versions.outputs.mod) || github.ref_name }}
files: build/libs/*.jar