Repository navigation
167 lines (152 loc) · 5.74 KB
/
Copy pathremotelymod-cloud.yml
File metadata and controls
167 lines (152 loc) · 5.74 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
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
166
167
name: RemotelyMod Cloud
on:
workflow_dispatch:
inputs:
goal:
description: Gradle aggregate task
required: true
type: choice
options:
- buildAllVersions
- publishAllVersions
- publishAllVersionsToModrinth
- publishAllVersionsToCurseForge
- publishAllFabric
- publishAllNeoForge
publish_confirm:
description: Type PUBLISH to run a publish goal
required: false
type: string
default: ''
remotely_ref:
description: Remotely git ref (blank = workflow branch)
required: false
type: string
default: ''
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
rescreen_ref: ${{ steps.dependencies.outputs.rescreen }}
remodel_ref: ${{ steps.dependencies.outputs.remodel }}
rebase_ref: ${{ steps.dependencies.outputs.rebase }}
recast_ref: ${{ steps.dependencies.outputs.recast }}
resync_ref: ${{ steps.dependencies.outputs.resync }}
steps:
- id: dependencies
shell: bash
env:
GH_TOKEN: ${{ secrets.REPROJECTS_PAT }}
run: |
resolve() {
local repository=$1
local output=$2
local branch
branch=$(gh api "repos/$repository" --jq '.default_branch')
printf '%s=%s\n' "$output" "$(gh api "repos/$repository/commits/$branch" --jq '.sha')" >> "$GITHUB_OUTPUT"
}
resolve RedxAx/ReScreen rescreen
resolve RedxAx/Remodel remodel
resolve RedxAx/Rebase rebase
resolve RedxAx/Recast recast
resolve RedxAx/ReSync resync
remotelymod:
needs: prepare
runs-on: [self-hosted, node1, linux, release]
timeout-minutes: 480
env:
ORG_GRADLE_PROJECT_org.gradle.jvmargs: -Xmx8g -Dfile.encoding=UTF-8
ORG_GRADLE_PROJECT_org.gradle.workers.max: '2'
GRADLE_USER_HOME: /var/cache/restudio-gradle
steps:
- name: Reject publish without confirmation
if: startsWith(inputs.goal, 'publish') && inputs.publish_confirm != 'PUBLISH'
run: |
echo "Publish goals require publish_confirm = PUBLISH"
exit 1
- name: Checkout Remotely
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
path: Remotely
ref: ${{ inputs.remotely_ref != '' && inputs.remotely_ref || github.ref }}
- name: Checkout ReScreen
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
repository: RedxAx/ReScreen
token: ${{ secrets.REPROJECTS_PAT }}
path: ReScreen
ref: ${{ needs.prepare.outputs.rescreen_ref }}
- name: Checkout Remodel
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
repository: RedxAx/Remodel
token: ${{ secrets.REPROJECTS_PAT }}
path: Remodel
ref: ${{ needs.prepare.outputs.remodel_ref }}
- name: Checkout Rebase
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
repository: RedxAx/Rebase
token: ${{ secrets.REPROJECTS_PAT }}
path: Rebase
ref: ${{ needs.prepare.outputs.rebase_ref }}
- name: Checkout Recast
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
repository: RedxAx/Recast
token: ${{ secrets.REPROJECTS_PAT }}
path: Recast
ref: ${{ needs.prepare.outputs.recast_ref }}
- name: Checkout ReSync
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
repository: RedxAx/ReSync
token: ${{ secrets.REPROJECTS_PAT }}
path: ReSync
ref: ${{ needs.prepare.outputs.resync_ref }}
- name: Ensure Remodel Java 21 toolchain
run: |
chmod +x Remotely/RemotelyMod/scripts/ci-ensure-remodel-java21.sh
Remotely/RemotelyMod/scripts/ci-ensure-remodel-java21.sh Remodel
- name: Set up JDK 21
uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9
with:
distribution: temurin
java-version: '21'
cache: gradle
- name: Preflight Remotely App jar
working-directory: Remotely
run: |
chmod +x gradlew
flock /var/lock/restudio-release-build.lock ./gradlew jar --no-daemon --stacktrace
- name: Ensure version project directories
working-directory: Remotely/RemotelyMod
run: |
chmod +x scripts/ensure-version-project-dirs.sh
./scripts/ensure-version-project-dirs.sh
- name: Run RemotelyMod Gradle goal
working-directory: Remotely/RemotelyMod
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
run: |
chmod +x gradlew
goal="${{ inputs.goal }}"
publish_task=""
echo "workflow goal=$goal"
if [[ "$goal" == publish* ]]; then
publish_task="$goal"
fi
if [[ -n "$publish_task" ]]; then
echo "Building all versions, then $publish_task (separate Gradle runs)."
flock /var/lock/restudio-release-build.lock ./gradlew buildAllVersions --no-daemon --stacktrace
flock /var/lock/restudio-release-build.lock ./gradlew "$publish_task" --no-daemon --stacktrace
else
flock /var/lock/restudio-release-build.lock ./gradlew "$goal" --no-daemon --stacktrace
fi
- name: Upload mod jars
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: remotelymod-versions
path: Remotely/RemotelyMod/build/versions/*.jar
if-no-files-found: error