-
Notifications
You must be signed in to change notification settings - Fork 27
134 lines (116 loc) · 4.1 KB
/
auto-build-publish-release.yml
File metadata and controls
134 lines (116 loc) · 4.1 KB
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
name: Auto Build, Publish, Releasing
on:
workflow_dispatch:
inputs:
publishMaven:
description: 'whether publish to the maven'
required: true
type: boolean
default: true
publishCurseForgeAndModrinth:
description: 'whether publish to the curseforge and modrinth'
required: true
type: boolean
default: true
versionType:
description: 'version type'
required: true
type: choice
options:
- 'alpha'
- 'beta'
- 'release'
default: 'alpha'
jobs:
build:
runs-on: ubuntu-latest
env:
MAVEN_PASS: ${{ secrets.MAVEN_PASS }}
MAVEN_USER: ${{ secrets.MAVEN_USER }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build
uses: gradle/gradle-build-action@v2.4.2
with:
arguments: build
- if: ${{ inputs.publishMaven }}
name: Publish to Maven
uses: gradle/gradle-build-action@v2.4.2
with:
arguments: publish
- if: ${{ inputs.publishCurseForgeAndModrinth }}
name: Get Version
id: var
run: |
MESSAGE=$(ls fabric/build/libs/* | grep sources.jar -v | grep shadow.jar -v | awk -F 'photon-fabric-|.jar' '{print $2}')
echo fabric_version=$MESSAGE >> $GITHUB_OUTPUT
MESSAGE=$(ls forge/build/libs/* | grep sources.jar -v | grep shadow.jar -v | awk -F 'photon-forge-|.jar' '{print $2}')
echo forge_version=$MESSAGE >> $GITHUB_OUTPUT
- if: ${{ inputs.publishCurseForgeAndModrinth }}
name: mc-publish-fabric
uses: Kir-Antipov/mc-publish@v3.3
with:
# Only include this section if you wish to publish
# your assets on Modrinth.
modrinth-id: gzevkJbM
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
# Only include this section if you wish to publish
# your assets on CurseForge.
curseforge-id: 871522
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
files: |
fabric/build/libs/!(*-@(dev|sources|javadoc|dev-shadow)).jar
fabric/build/libs/*-@(dev|sources|javadoc|dev-shadow).jar
name: Photon Editor ${{ steps.var.outputs.fabric_version }}-fabric
version: mc${{ steps.var.outputs.fabric_version }}-fabric
version-type: ${{ inputs.versionType }}
changelog-file: CHANGELOG.*
loaders: |
fabric
game-versions: |
${{ github.ref_name }}
game-version-filter: none
java: |
17
retry-attempts: 2
retry-delay: 10000
fail-mode: fail
- if: ${{ inputs.publishCurseForgeAndModrinth }}
name: mc-publish-forge
uses: Kir-Antipov/mc-publish@v3.3
with:
# Only include this section if you wish to publish
# your assets on Modrinth.
modrinth-id: gzevkJbM
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
# Only include this section if you wish to publish
# your assets on CurseForge.
curseforge-id: 871522
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
files: |
forge/build/libs/!(*-@(dev|sources|javadoc|dev-shadow)).jar
forge/build/libs/*-@(dev|sources|javadoc|dev-shadow).jar
name: Photon Editor ${{ steps.var.outputs.forge_version }}-forge
version: mc${{ steps.var.outputs.forge_version }}-forge
version-type: ${{ inputs.versionType }}
changelog-file: CHANGELOG.*
loaders: |
forge
game-versions: |
${{ github.ref_name }}
game-version-filter: none
java: |
17
retry-attempts: 2
retry-delay: 10000
fail-mode: fail