-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (55 loc) · 1.62 KB
/
release.yml
File metadata and controls
68 lines (55 loc) · 1.62 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
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'The version of the release (e.g. 1.0.0)'
required: true
type: string
run-name: Build+${{ github.run_number }} release/${{ inputs.version }}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: write
jobs:
release:
name: 🎉 Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Check version in gradle.properties
run: |
MOD_VERSION=$(grep "^mod_version=" gradle.properties | cut -d'=' -f2)
echo "Found mod version: $MOD_VERSION"
if [ "$MOD_VERSION" != "${{ inputs.version }}" ]; then
echo "Version mismatch! gradle.properties=$MOD_VERSION input=${{ inputs.version }}"
exit 1
fi
- name: Set up JDK
uses: actions/setup-java@v5
with:
java-version: '23'
distribution: 'temurin'
cache: gradle
- name: Make gradle wrapper executable
run: chmod +x ./gradlew
- name: Build with Gradle
run: ./gradlew build --full-stacktrace
- name: Upload artifacts
uses: actions/upload-artifact@v5
with:
name: Artifacts
path: build/libs/
- name: Create release notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ inputs.version }}
run: |
gh release create "$tag" \
--target main \
--repo="$GITHUB_REPOSITORY" \
--title="$tag" \
--generate-notes