-
-
Notifications
You must be signed in to change notification settings - Fork 5
151 lines (136 loc) · 5.3 KB
/
Copy pathremotelymod-cloud.yml
File metadata and controls
151 lines (136 loc) · 5.3 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
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 upload (uses Modrinth when goal is buildAllVersions)
required: false
type: string
default: ''
remotely_ref:
description: Remotely git ref (blank = workflow branch)
required: false
type: string
default: ''
jobs:
remotelymod:
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: Read Workspace Lock
id: refs
working-directory: Remotely
run: |
lock=.restudio/workspace.lock.json
for project in ReScreen Remodel Rebase Recast ReSync; do
printf '%s=%s\n' "${project,,}" "$(jq -r --arg project "$project" '.[$project]' "$lock")" >> "$GITHUB_OUTPUT"
done
- name: Checkout ReScreen
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
repository: RedxAx/ReScreen
token: ${{ secrets.REPROJECTS_PAT }}
path: ReScreen
ref: ${{ steps.refs.outputs.rescreen }}
- name: Checkout Remodel
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
repository: RedxAx/Remodel
token: ${{ secrets.REPROJECTS_PAT }}
path: Remodel
ref: ${{ steps.refs.outputs.remodel }}
- name: Checkout Rebase
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
repository: RedxAx/Rebase
token: ${{ secrets.REPROJECTS_PAT }}
path: Rebase
ref: ${{ steps.refs.outputs.rebase }}
- name: Checkout Recast
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
repository: RedxAx/Recast
token: ${{ secrets.REPROJECTS_PAT }}
path: Recast
ref: ${{ steps.refs.outputs.recast }}
- name: Checkout ReSync
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
repository: RedxAx/ReSync
token: ${{ secrets.REPROJECTS_PAT }}
path: ReSync
ref: ${{ steps.refs.outputs.resync }}
- 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 }}"
confirm="${{ inputs.publish_confirm }}"
publish_task=""
echo "workflow goal=$goal publish_confirm=$confirm"
if [[ "$confirm" == "PUBLISH" && "$goal" == "buildAllVersions" ]]; then
publish_task="publishAllVersionsToModrinth"
elif [[ "$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