-
Notifications
You must be signed in to change notification settings - Fork 19
80 lines (75 loc) · 2.9 KB
/
publish.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
name: publish
on:
push:
tags:
- '*'
jobs:
build:
name: Build for Publish
runs-on: Felix
outputs:
mc_version: ${{ steps.verinfo.outputs.mcver }}
mc_major_version: ${{ steps.mverinfo.outputs.mcver }}
release_type: ${{ steps.relinfo.outputs.reltype }}
quartz_version_range: ${{ steps.mainbuild.outputs.quartz_version_range }}
phos_version_range: ${{ steps.mainbuild.outputs.phos_version_range }}
steps:
- uses: actions/checkout@v2
- run: git submodule update --init --recursive
- id: mainbuild
run: ./gradlew build
- run: ./gradlew publishToMavenLocal
- run: mkdir jars
- run: mv build/libs/biggerreactors-* jars/
- uses: actions/upload-artifact@v2
with:
name: jars
path: jars/*
- id: verinfo
run: echo "::set-output name=mcver::$(cat gradle.properties | grep mc_version | sed -n -e 's/^.*=//p')"
- id: mverinfo
run: echo "::set-output name=mcver::$(cat gradle.properties | grep mc_version | grep -o '1...' )"
- id: relinfo
run: echo "::set-output name=reltype::$(cat gradle.properties | grep "postfixVersion=" | sed -n -e 's/^.*=//p' | grep -o '[a-z]*')"
uploadToCurseforge:
name: Upload to Curseforge
runs-on: Felix
needs: [build]
outputs:
curseforge_file_id: ${{ steps.upload.outputs.id }}
steps:
- uses: actions/[email protected]
with:
name: jars
path: jars/*
- id: upload
uses: itsmeow/[email protected]
with:
token: "${{ secrets.CF_API_TOKEN }}"
project_id: 407780
game_endpoint: minecraft
file_path: "jars/biggerreactors-${{ needs.build.outputs.mc_version }}-${{ github.ref_name }}.jar"
game_versions: "Minecraft ${{ needs.build.outputs.mc_major_version }}:${{ needs.build.outputs.mc_version }},Java 17,Forge"
release_type: "${{ needs.build.outputs.release_type }}"
relations: "phosphophyllite:requiredDependency,quartz:requiredDependency"
changelog: "https://github.com/BiggerSeries/BiggerReactors/blob/${{ github.ref_name }}/changelog.md
${{ needs.build.outputs.quartz_version_range }}
${{ needs.build.outputs.phos_version_range }}"
addToGithubRelease:
name: Upload to Github Release
runs-on: Felix
needs: [build, uploadToCurseforge]
steps:
- uses: actions/[email protected]
with:
name: jars
path: jars/*
- uses: svenstaro/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: jars/*
tag: ${{ github.ref }}
overwrite: true
file_glob: true
body: "https://www.curseforge.com/minecraft/mc-mods/biggerreactors/files/${{ needs.uploadToCurseforge.outputs.curseforge_file_id }}"