Skip to content

Commit 54cb180

Browse files
committed
fix: workflow
1 parent a7802c0 commit 54cb180

File tree

1 file changed

+51
-10
lines changed

1 file changed

+51
-10
lines changed

.github/workflows/release-dev.yml

Lines changed: 51 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
env:
1010
APP_SLUG: cloud-api-plugin
1111
REGISTRY_URL: https://registry.simplecloud.app
12-
MINECRAFT_VERSIONS: '["1.20","1.20.1","1.20.2","1.20.3","1.20.4","1.20.5","1.20.6","1.21","1.21.1","1.21.2","1.21.3","1.21.4"]'
12+
MINECRAFT_VERSIONS: '["1.20","1.20.1","1.20.2","1.20.3","1.20.4","1.20.5","1.20.6","1.21","1.21.1","1.21.2","1.21.3","1.21.4","1.21.5"]'
1313

1414
jobs:
1515
build:
@@ -76,62 +76,103 @@ jobs:
7676
- name: Create Registry Release
7777
id: create_registry_release
7878
run: |
79+
RELEASE_URL="${REGISTRY_URL}/v1/applications/${APP_SLUG}/releases"
80+
echo "Creating release at: $RELEASE_URL"
81+
echo "Headers:"
82+
echo " Content-Type: application/json"
83+
echo "Body:"
84+
echo '{
85+
"version": "'"${{ needs.build.outputs.gradle_version }}"'",
86+
"manual_update": false
87+
}'
7988
response=$(curl -X POST \
8089
-H "Authorization: Bearer ${{ secrets.REGISTRY_TOKEN }}" \
8190
-H "Content-Type: application/json" \
82-
"${REGISTRY_URL}/v1/applications/${APP_SLUG}/releases" \
91+
"$RELEASE_URL" \
8392
-d '{
8493
"version": "'"${{ needs.build.outputs.gradle_version }}"'",
8594
"manual_update": false
8695
}')
8796
echo "Response: $response"
8897
APP_ID=$(echo $response | jq -r '.release.application_id')
8998
echo "APP_ID=$APP_ID" >> $GITHUB_ENV
90-
91-
- name: List artifacts directory
92-
run: ls -R artifacts
99+
echo "Release created with APP_ID: $APP_ID"
93100
94101
- name: Upload to Registry
95102
run: |
96103
# Upload Spigot Platform
104+
SPIGOT_URL="${REGISTRY_URL}/v1/applications/${APP_ID}/releases/${{ needs.build.outputs.gradle_version }}/files"
105+
echo "Uploading Spigot to: $SPIGOT_URL"
106+
echo "Headers:"
107+
echo " Content-Type: multipart/form-data"
108+
echo "Form data:"
109+
echo " platform: minecraft_plugin"
110+
echo " arch: spigot"
111+
echo " platform_versions: ${{ env.MINECRAFT_VERSIONS }}"
97112
curl -X POST \
98113
-H "Authorization: Bearer ${{ secrets.REGISTRY_TOKEN }}" \
99114
-H "Content-Type: multipart/form-data" \
100115
-F "file=@artifacts/spigot.jar" \
101116
-F "platform=minecraft_plugin" \
102117
-F "arch=spigot" \
103118
-F "platform_versions=${{ env.MINECRAFT_VERSIONS }}" \
104-
"${REGISTRY_URL}/v1/applications/${APP_ID}/releases/${{ needs.build.outputs.gradle_version }}/files"
119+
"$SPIGOT_URL"
105120
106121
# Upload Paper Platform (same jar as Spigot)
122+
PAPER_URL="${REGISTRY_URL}/v1/applications/${APP_ID}/releases/${{ needs.build.outputs.gradle_version }}/files"
123+
echo "Uploading Paper to: $PAPER_URL"
124+
echo "Headers:"
125+
echo " Content-Type: multipart/form-data"
126+
echo "Form data:"
127+
echo " platform: minecraft_plugin"
128+
echo " arch: paper"
129+
echo " platform_versions: ${{ env.MINECRAFT_VERSIONS }}"
107130
curl -X POST \
108131
-H "Authorization: Bearer ${{ secrets.REGISTRY_TOKEN }}" \
109132
-H "Content-Type: multipart/form-data" \
110133
-F "file=@artifacts/spigot.jar" \
111134
-F "platform=minecraft_plugin" \
112135
-F "arch=paper" \
113136
-F "platform_versions=${{ env.MINECRAFT_VERSIONS }}" \
114-
"${REGISTRY_URL}/v1/applications/${APP_ID}/releases/${{ needs.build.outputs.gradle_version }}/files"
137+
"$PAPER_URL"
115138
116139
# Upload BungeeCord Platform
140+
BUNGEE_URL="${REGISTRY_URL}/v1/applications/${APP_ID}/releases/${{ needs.build.outputs.gradle_version }}/files"
141+
echo "Uploading BungeeCord to: $BUNGEE_URL"
142+
echo "Headers:"
143+
echo " Content-Type: multipart/form-data"
144+
echo "Form data:"
145+
echo " platform: minecraft_plugin"
146+
echo " arch: bungeecord"
147+
echo " platform_versions: ${{ env.MINECRAFT_VERSIONS }}"
117148
curl -X POST \
118149
-H "Authorization: Bearer ${{ secrets.REGISTRY_TOKEN }}" \
119150
-H "Content-Type: multipart/form-data" \
120151
-F "file=@artifacts/bungeecord.jar" \
121152
-F "platform=minecraft_plugin" \
122153
-F "arch=bungeecord" \
123154
-F "platform_versions=${{ env.MINECRAFT_VERSIONS }}" \
124-
"${REGISTRY_URL}/v1/applications/${APP_ID}/releases/${{ needs.build.outputs.gradle_version }}/files"
155+
"$BUNGEE_URL"
125156
126157
# Upload Velocity Platform
158+
VELOCITY_URL="${REGISTRY_URL}/v1/applications/${APP_ID}/releases/${{ needs.build.outputs.gradle_version }}/files"
159+
echo "Uploading Velocity to: $VELOCITY_URL"
160+
echo "Headers:"
161+
echo " Content-Type: multipart/form-data"
162+
echo "Form data:"
163+
echo " platform: minecraft_plugin"
164+
echo " arch: velocity"
165+
echo " platform_versions: ${{ env.MINECRAFT_VERSIONS }}"
127166
curl -X POST \
128167
-H "Authorization: Bearer ${{ secrets.REGISTRY_TOKEN }}" \
129168
-H "Content-Type: multipart/form-data" \
130169
-F "file=@artifacts/velocity.jar" \
131170
-F "platform=minecraft_plugin" \
132171
-F "arch=velocity" \
133172
-F "platform_versions=${{ env.MINECRAFT_VERSIONS }}" \
134-
"${REGISTRY_URL}/v1/applications/${APP_ID}/releases/${{ needs.build.outputs.gradle_version }}/files"
173+
"$VELOCITY_URL"
174+
175+
echo "All uploads completed"
135176
136177
publish-maven:
137178
needs: build
@@ -189,7 +230,7 @@ jobs:
189230
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
190231

191232
create-github-release:
192-
needs: [build, publish-registry, publish-maven, publish-modrinth]
233+
needs: [ build, publish-registry, publish-maven, publish-modrinth ]
193234
runs-on: ubuntu-latest
194235
steps:
195236
- name: Download artifacts

0 commit comments

Comments
 (0)