generated from CleanroomMC/TemplateDevEnv
-
Notifications
You must be signed in to change notification settings - Fork 19
89 lines (77 loc) · 2.94 KB
/
build.yaml
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
85
86
87
88
89
# This workflow must be manually triggered. It accepts a version and a release type.
# First it sets the version in gradle.properties to the new version and pushes it.
# Then it generates a log, based on commits.
# After that builds a jar and uploads it to curseforge/modrinth/GitHub releases
name: Publish mod version
on:
workflow_dispatch:
inputs:
version:
description: 'Mod version'
required: true
release_type:
description: 'Release type (release, beta, alpha)'
default: 'beta'
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
token: ${{ secrets.PAT }}
- name: Check if tag already exists
run: |
if git rev-parse --verify --quiet "v${{ github.event.inputs.version }}"; then
echo "Version ${{ github.event.inputs.version }} already exists, aborting workflow."
exit 1
fi
- name: Set version
run: sed -i "s/mod_version.*=.*/mod_version = ${{ github.event.inputs.version }}/g" gradle.properties
- name: Commit and push gradle.properties
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Bump version to ${{ github.event.inputs.version }}"
commit_options: "--no-verify"
file_pattern: gradle.properties
tagging_message: "v${{ github.event.inputs.version }}"
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Publish Minecraft Mods
uses: Kir-Antipov/[email protected]
with:
curseforge-id: 624243
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
modrinth-id: Ecvd12QC
modrinth-featured: true
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
github-tag: "v${{ github.event.inputs.version }}"
github-generate-changelog: true
github-draft: false
github-prerelease: false
github-token: ${{ secrets.PAT }}
files-primary: build/libs/!(*-@(dev|sources|javadoc)).jar
files-secondary: build/libs/*-@(dev|sources|javadoc).jar
name: ModularUI-${{ github.event.inputs.version }}
version: ${{ github.event.inputs.version }}
version-type: ${{ github.event.inputs.release_type }}
changelog: "[Click here](https://github.com/CleanroomMC/ModularUI/releases/tag/v${{ github.event.inputs.version }})"
loaders: |
forge
game-versions: |
1.12.2
dependencies: |
mixin-booter | depends | 5.0
jei | recommends | *
blur | recommends | *
java: |
8
retry-attempts: 2