Skip to content

Commit 4ecd65a

Browse files
committed
Add github action for DBO upload
1 parent 5fbe16e commit 4ecd65a

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/workflows/dbo_upload.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Manually upload release to dev.bukkit.org
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Release to upload'
8+
required: true
9+
10+
jobs:
11+
manually_upload_dbo_release:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Download release artifact
15+
id: release-artifact
16+
uses: dsaltares/fetch-gh-release-asset@master
17+
with:
18+
token: ${{ secrets.GITHUB_TOKEN }}
19+
version: tags/${{ github.event.inputs.version }}
20+
file: multiverse-core-${{ github.event.inputs.version }}.jar
21+
22+
- name: Build DBO metadata
23+
id: metadata
24+
uses: nickofthyme/object-remap@v1
25+
with:
26+
changelog: ${{ toJson(steps.release-artifact.outputs.body) }}
27+
changelog_type: markdown
28+
release_type: release
29+
display_name: ${{ github.event.inputs.version }}
30+
game_versions: '[9994, 9974, 9973, 9561, 9560, 9261, 9190, 9016, 8897, 8849, 8503, 7915, 7667, 7330, 7105]'
31+
relations.projects: '[{"slug": "multiverse-netherportals", "type": "optionalDependency"}, {"slug": "multiverse-portals", "type": "optionalDependency"}, {"slug": "multiverse-inventories", "type": "optionalDependency"}, {"slug": "multiverse-signportals", "type": "optionalDependency"}]'
32+
33+
- name: Upload to dev.bukkit.org
34+
uses: Multiverse/http-request-action@debug
35+
with:
36+
url: https://dev.bukkit.org/api/projects/30765/upload-file
37+
method: POST
38+
contentType: multipart/form-data
39+
customHeaders: '{ "X-Api-Token": "${{ secrets.DBO_UPLOAD_API_TOKEN }}" }'
40+
files: '{ "file": "${{ github.workspace }}/multiverse-core-${{ github.event.inputs.version }}.jar" }'
41+
data: '{ "metadata": ${{ toJson(steps.metadata.outputs.json) }} }'
42+
43+
# Bukkit Version IDs
44+
# 9994: 1.20.1
45+
# 9974: 1.20
46+
# 9973: 1.19.4
47+
# 9561: 1.19.3
48+
# 9560: 1.19.2
49+
# 9261: 1.19.1
50+
# 9190: 1.19
51+
# 9016: 1.18.2
52+
# 8897: 1.18.1
53+
# 8849: 1.18
54+
# 8503: 1.17
55+
# 7915: 1.16
56+
# 7667: 1.15
57+
# 7330: 1.14
58+
# 7105: 1.13

0 commit comments

Comments
 (0)