generated from jaredlll08/MultiLoader-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (96 loc) · 3.27 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
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: Publish release on GitHub, CurseForge & Modrinth
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
env:
MINECRAFT_VERSION: 1.19.2
JAVA_VERSION: 17
GITLAB_URL: https://git.griefed.de
GITLAB_PROJECT_ID: 119
permissions:
contents: write
jobs:
preparations:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.tag.outputs.tag }}
steps:
- name: Checkout latest code
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Get tag
id: tag
uses: tj-actions/[email protected]
- name: Use tag
run: echo ${{steps.tag.outputs.tag}}
# GET RELEASE INFO
- name: Get Release Info
run: |
curl --header \
'PRIVATE-TOKEN: ${{ secrets.GITLAB_TOKEN }}' \
'${{ env.GITLAB_URL }}/api/v4/projects/${{ env.GITLAB_PROJECT_ID }}/releases/${{ needs.preparations.outputs.version }}' >> version.json
# GET DESCRIPTION
- name: Extract version changelog
uses: sergeysova/[email protected]
id: description
with:
cmd: "jq .description version.json -r | sed -e 's/\\n/\\n/g' > description.txt"
multiline: true
- name: Dafuq # Otherwise we wouldn't be able to work with the file. Because reasons...
run: sudo chown $USER description.txt
- name: Create Release
id: create_release
uses: softprops/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ needs.preparations.outputs.version }}
name: Pre-Release ${{ needs.preparations.outputs.version }}
body_path: description.txt
draft: false
build:
needs: preparations
strategy:
matrix:
include:
- platform: forge
name: Forge
- platform: fabric
name: Fabric
runs-on: ubuntu-latest
steps:
- name: Check Environment Variables
run: env
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: true
- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: "temurin"
java-version: 17
- name: Make Gradle Wrapper Executable
run: chmod +x ./gradlew
- name: Clean
run: ./gradlew clean blockAndItemCodeGen --info --full-stacktrace
- name: Build
run: ./gradlew -Pversion="${{ needs.preparations.outputs.version }}" :${{ matrix.name }}:build --info --full-stacktrace
- name: Publish (CurseForge/Modrinth/GitHub)
uses: Kir-Antipov/[email protected]
with:
loaders: |
${{ matrix.platform }}
curseforge-id: 935081
curseforge-token: "${{ secrets.CURSEFORGE_TOKEN }}"
modrinth-id: usDxEvVr
modrinth-token: "${{ secrets.MODRINTH_TOKEN }}"
modrinth-unfeature-mode: loader-any
github-tag: "${{ needs.preparations.outputs.version }}"
github-token: "${{ secrets.GITHUB_TOKEN }}"
name: "AddEmAll ${{ matrix.name }} ${{ needs.preparations.outputs.version }} for Minecraft 1.19.2"
game-versions: "${{ env.MINECRAFT_VERSION }}"
java: "${{ env.JAVA_VERSION }}"
files: |
${{ matrix.name }}/build/libs/*[0-9].jar