-
Notifications
You must be signed in to change notification settings - Fork 21
58 lines (55 loc) · 2.05 KB
/
release.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
name: "Build a release"
# Controls when the action will run. Triggers the workflow on push or pull request
# events for the branches listed
on:
release:
types: [ published ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Export release tag as environment variable
env:
TAG: ${{ github.event.release.tag_name }}
run: |
echo "TAG=${TAG}" >> $GITHUB_ENV
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '21'
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: false
- name: Remove any generated assets/data
run: rm -rf ./src/generated
- name: Generate assets & data
run: ./gradlew runData --no-daemon
- name: Validate assets
run: test -d ./src/generated -a -d ./src/generated/resources/.cache
- name: Build JAR
run: ./gradlew build --no-daemon
env:
BUILD_NUMBER: ${{ github.run_number }}
- name: Set up mod metadata
id: mod_meta
run: |
echo mod_version=$(grep ^mod_version= ./gradle.properties | cut -d= -f2) >> $GITHUB_OUTPUT
echo mc_version=$(grep ^minecraft_version= ./gradle.properties | cut -d= -f2) >> $GITHUB_OUTPUT
- name: Publish to Modmaven
run: ./gradlew publishMavenPublicationToModmavenRepository --no-daemon
env:
MODMAVEN_USER: ${{ secrets.MODMAVEN_USER }}
MODMAVEN_PASSWORD: ${{ secrets.MODMAVEN_PASSWORD }}
- name: Publish to Curseforge/Modrinth
run: ./gradlew publishMods --no-daemon
env:
CHANGELOG: ${{ github.event.release.body }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
DISCORD_WEBHOOK: ${{ secrets.DISCORD_RELEASE_WEBHOOK }}
BUILD_NUMBER: ${{ github.run_number }}