-
-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (139 loc) · 4.68 KB
/
publish_snapshot_ports.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
name: Publish Snapshot Mod Ports
run-name: Publish mod ports for ${{ github.event.inputs.snapshot }}
on:
workflow_dispatch:
inputs:
snapshot:
description: "Minecraft version / branch name to publish from"
required: true
include_wurst:
description: "Include Wurst Client"
type: boolean
required: false
default: true
include_wi_zoom:
description: "Include WI Zoom"
type: boolean
required: false
default: true
include_mo_glass:
description: "Include Mo Glass"
type: boolean
required: false
default: true
jobs:
wurst:
runs-on: ubuntu-latest
if: ${{ inputs.include_wurst }}
steps:
- name: Build Wurst publish inputs
id: wurst_inputs
run: |
JSON_STRING=$(cat << EOF
{
"close_milestone": "false",
"upload_backups": "true",
"publish_github": "true",
"update_website": "true",
"announce_backport": "false"
}
EOF
)
# Convert to single line and escape quotes
echo "json=${JSON_STRING//$'\n'/}" >> "$GITHUB_OUTPUT"
- name: Trigger publish workflow
id: wurst_dispatch
uses: codex-/return-dispatch@v2
with:
token: ${{ secrets.SNAPSHOT_MODS_ACTIONS_TOKEN }}
owner: Wurst-Imperium
repo: Wurst7
ref: ${{ github.event.inputs.snapshot }}
workflow: publish.yml
workflow_inputs: ${{ steps.wurst_inputs.outputs.json }}
- name: Wait for publish workflow to finish (run ${{ steps.wurst_dispatch.outputs.run_id }})
uses: codex-/await-remote-run@v1
with:
token: ${{ secrets.SNAPSHOT_MODS_ACTIONS_TOKEN }}
owner: Wurst-Imperium
repo: Wurst7
run_id: ${{ steps.wurst_dispatch.outputs.run_id }}
run_timeout_seconds: 600 # 10 minutes
wi_zoom:
runs-on: ubuntu-latest
if: ${{ inputs.include_wi_zoom }}
steps:
- name: Build WI Zoom publish inputs
id: wi_zoom_inputs
run: |
JSON_STRING=$(cat << EOF
{
"close_milestone": "false",
"upload_backups": "true",
"publish_github": "true",
"publish_curseforge": "true",
"publish_modrinth": "true",
"update_website": "true"
}
EOF
)
# Convert to single line and escape quotes
echo "json=${JSON_STRING//$'\n'/}" >> "$GITHUB_OUTPUT"
- name: Trigger publish workflow
id: wi_zoom_dispatch
uses: codex-/return-dispatch@v2
with:
token: ${{ secrets.SNAPSHOT_MODS_ACTIONS_TOKEN }}
owner: Wurst-Imperium
repo: WI-Zoom
ref: ${{ github.event.inputs.snapshot }}
workflow: publish.yml
workflow_inputs: ${{ steps.wi_zoom_inputs.outputs.json }}
- name: Wait for publish workflow to finish (run ${{ steps.wi_zoom_dispatch.outputs.run_id }})
uses: codex-/await-remote-run@v1
with:
token: ${{ secrets.SNAPSHOT_MODS_ACTIONS_TOKEN }}
owner: Wurst-Imperium
repo: WI-Zoom
run_id: ${{ steps.wi_zoom_dispatch.outputs.run_id }}
run_timeout_seconds: 600 # 10 minutes
mo_glass:
# Can't have two mods updating the wimods.net website at the same time.
needs: wi_zoom
runs-on: ubuntu-latest
if: ${{ inputs.include_mo_glass }}
steps:
- name: Build Mo Glass publish inputs
id: mo_glass_inputs
run: |
JSON_STRING=$(cat << EOF
{
"close_milestone": "false",
"upload_backups": "true",
"publish_github": "true",
"publish_curseforge": "true",
"publish_modrinth": "true",
"update_website": "true"
}
EOF
)
# Convert to single line and escape quotes
echo "json=${JSON_STRING//$'\n'/}" >> "$GITHUB_OUTPUT"
- name: Trigger publish workflow
id: mo_glass_dispatch
uses: codex-/return-dispatch@v2
with:
token: ${{ secrets.SNAPSHOT_MODS_ACTIONS_TOKEN }}
owner: Wurst-Imperium
repo: Mo-Glass
ref: ${{ github.event.inputs.snapshot }}
workflow: publish.yml
workflow_inputs: ${{ steps.mo_glass_inputs.outputs.json }}
- name: Wait for publish workflow to finish (run ${{ steps.mo_glass_dispatch.outputs.run_id }})
uses: codex-/await-remote-run@v1
with:
token: ${{ secrets.SNAPSHOT_MODS_ACTIONS_TOKEN }}
owner: Wurst-Imperium
repo: Mo-Glass
run_id: ${{ steps.mo_glass_dispatch.outputs.run_id }}
run_timeout_seconds: 600 # 10 minutes