-
Notifications
You must be signed in to change notification settings - Fork 25
165 lines (152 loc) · 5.57 KB
/
publish.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: publish
on:
workflow_dispatch:
inputs:
release-type:
description: "release type"
default: release
required: true
type: choice
options:
- alpha
- beta
- release
changelog:
description: "change log"
required: true
type: string
maven-repository:
description: "maven repository"
required: true
type: boolean
default: true
github-release:
description: "publish github release"
type: boolean
default: true
modrinth:
description: "publish modrinth"
type: boolean
default: true
curseforge:
description: "publish curseforge"
type: boolean
default: true
forge:
description: "forge"
type: boolean
default: true
fabric:
description: "fabric"
type: boolean
default: true
jobs:
call-build-workflow:
permissions:
contents: read
uses: "./.github/workflows/build.yml"
upload-maven:
needs: call-build-workflow
runs-on: ubuntu-latest
if: inputs.maven-repository
env:
MAVEN_PASS: ${{ secrets.MAVEN_PASS }}
MAVEN_USER: ${{ secrets.MAVEN_USER }}
steps:
- name: Download shimmer artifact
uses: actions/download-artifact@v3
continue-on-error: true
with:
name: Shimmer
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Grant execute permission for gradle
run: chmod +x gradlew
- name: Publish to Maven
uses: gradle/[email protected]
with:
arguments: publish
publish:
needs: call-build-workflow
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
loader: [ Forge, Fabric ]
website: [ modrinth, curseforge, github_release ]
name: ${{ matrix.website }} (${{ matrix.loader }})
steps:
- name: Download shimmer artifact
uses: actions/download-artifact@v3
continue-on-error: true
with:
name: Shimmer
- name: Checking and setting the environment
id: shimmer_env
continue-on-error: true
run: |
export loader=${{ matrix.loader }}
export name=$(ls ${loader}/build/libs/ | grep shadow -v | grep sources -v | awk -F.jar '{print $1}')
export mod_name=$(echo $name | awk -F- '{print $1}')
export loader_name=$(echo $name | awk -F- '{print $2}')
export mc_version=$(echo $name | awk -F- '{print $3}')
export mod_version=$(echo $name | awk -F- '{print $4}')
export full_version=$(echo ${mc_version}-${mod_version})
echo "name=$name" >> $GITHUB_OUTPUT
echo "mod_name=$mod_name" >> $GITHUB_OUTPUT
echo "loader_name=$loader_name" >> $GITHUB_OUTPUT
echo "mc_version=$mc_version" >> $GITHUB_OUTPUT
echo "mod_version=$mod_version" >> $GITHUB_OUTPUT
echo "full_version=$full_version" >> $GITHUB_OUTPUT
rm ${loader}/build/libs/*shadow.jar
- name: Publish Github Release
uses: Kir-Antipov/[email protected]
continue-on-error: true
if: (matrix.website == 'github_release' && inputs.github-release) && ((matrix.loader == 'Forge' && inputs.forge) || (matrix.loader == 'Fabric' && inputs.fabric))
with:
files: |
${{ matrix.loader }}/build/libs/!(*-@(dev|sources|javadoc)).jar
${{ matrix.loader }}/build/libs/*-@(dev|sources|javadocs).jar
name : ${{ steps.shimmer_env.outputs.name }}
version : ${{ steps.shimmer_env.outputs.full_version }}
version-type: ${{ inputs.release-type }}
changelog: ${{ inputs.changelog }}
java : Java 18
github-token: ${{ secrets.GITHUB_TOKEN }}
github-generate-changelog: true
- name: Publish Modrinth Release
uses: Kir-Antipov/[email protected]
continue-on-error: true
if : (matrix.website == 'modrinth' && inputs.modrinth) && ((matrix.loader == 'Forge' && inputs.forge) || (matrix.loader == 'Fabric' && inputs.fabric))
with:
files: |
${{ matrix.loader }}/build/libs/!(*-@(dev|sources|javadoc)).jar
${{ matrix.loader }}/build/libs/*-@(dev|sources|javadocs).jar
name: ${{ steps.shimmer_env.outputs.name }}
version: ${{ steps.shimmer_env.outputs.full_version }}
version-type: ${{ inputs.release-type }}
changelog: ${{ inputs.changelog }}
java: Java 18
modrinth-id: uBKACKpl
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
- name: Publish Curseforge Release
uses: Kir-Antipov/[email protected]
continue-on-error: true
if: (matrix.website == 'curseforge' && inputs.curseforge) && ((matrix.loader == 'Forge' && inputs.forge) || (matrix.loader == 'Fabric' && inputs.fabric))
with:
files: |
${{ matrix.loader }}/build/libs/!(*-@(dev|sources|javadoc)).jar
${{ matrix.loader }}/build/libs/*-@(dev|sources|javadocs).jar
name: ${{ steps.shimmer_env.outputs.name }}
version: ${{ steps.shimmer_env.outputs.full_version }}
version-type: ${{ inputs.release-type }}
changelog: ${{ inputs.changelog }}
java: Java 18
curseforge-id: 627824
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}