Skip to content

Commit 6e6c04a

Browse files
authored
Merge pull request #659 from Multiverse/actions-revamp
feat: Revamp actions with new release and upload system
2 parents 280e88c + 59db7d9 commit 6e6c04a

12 files changed

+206
-202
lines changed

.github/labeler.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: 'Call: GitHub Release'
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
release_mode:
7+
description: 'Release mode'
8+
required: true
9+
type: string
10+
version_bump:
11+
description: 'Version bump'
12+
required: false
13+
type: string
14+
promote_from:
15+
description: 'Promote from'
16+
required: false
17+
type: string
18+
outputs:
19+
release_created:
20+
description: 'Release created'
21+
value: ${{ jobs.github_release.outputs.release_created }}
22+
tag_name:
23+
description: 'Tag name'
24+
value: ${{ jobs.github_release.outputs.tag_name }}
25+
26+
jobs:
27+
github_release:
28+
uses: Multiverse/Multiverse-Core/.github/workflows/generic.github_release.yml@main
29+
secrets: inherit
30+
with:
31+
plugin_name: multiverse-portals
32+
release_mode: ${{ inputs.release_mode }}
33+
version_bump: ${{ inputs.version_bump }}
34+
promote_from: ${{ inputs.promote_from }}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: 'Call: Platform Uploads'
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
target_tag:
7+
description: 'Version to upload'
8+
required: true
9+
type: string
10+
upload_modrinth:
11+
description: 'Upload to modrinth.com'
12+
required: true
13+
type: string
14+
upload_dbo:
15+
description: 'Upload to dev.bukkit.org'
16+
required: true
17+
type: string
18+
upload_hangar:
19+
description: 'Upload to hangar.papermc.io'
20+
required: true
21+
type: string
22+
secrets:
23+
MODRINTH_TOKEN:
24+
required: true
25+
DBO_UPLOAD_API_TOKEN:
26+
required: true
27+
HANGAR_UPLOAD_TOKEN:
28+
required: true
29+
30+
jobs:
31+
platform_uploads:
32+
uses: Multiverse/Multiverse-Core/.github/workflows/generic.platform_uploads.yml@main
33+
secrets: inherit
34+
with:
35+
plugin_name: multiverse-portals
36+
37+
modrinth_project_id: 8VMk6P0I
38+
modrinth_dependencies: >
39+
[
40+
{"project_id": "3wmN97b8", "dependency_type": "required"}
41+
]
42+
43+
dbo_project_id: 30781
44+
dbo_project_relations: >
45+
[
46+
{"slug": "multiverse-core", "type": "requiredDependency"},
47+
{"slug": "worldedit", "type": "optionalDependency"}
48+
]
49+
50+
hangar_slug: Multiverse-Portals
51+
hangar_plugin_dependencies: >
52+
{ "PAPER": [
53+
{
54+
"name": "Multiverse-Core",
55+
"required": true,
56+
"namespace": {
57+
"owner": "Multiverse",
58+
"slug": "Multiverse-Core"
59+
}
60+
}
61+
]}
62+
63+
target_tag: ${{ inputs.target_tag }}
64+
upload_modrinth: ${{ inputs.upload_modrinth }}
65+
upload_dbo: ${{ inputs.upload_dbo }}
66+
upload_hangar: ${{ inputs.upload_hangar }}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: 'Dispatch: Platform Uploads'
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
target_tag:
7+
description: 'Version to upload'
8+
required: true
9+
type: string
10+
upload_modrinth:
11+
description: 'Upload to modrinth.com'
12+
required: true
13+
type: boolean
14+
upload_dbo:
15+
description: 'Upload to dev.bukkit.org'
16+
required: true
17+
type: boolean
18+
upload_hangar:
19+
description: 'Upload to hangar.papermc.io'
20+
required: true
21+
type: boolean
22+
23+
jobs:
24+
dispatch_platform_uploads:
25+
uses: ./.github/workflows/call.platform_uploads.yml
26+
secrets: inherit
27+
with:
28+
target_tag: ${{ github.event.inputs.target_tag }}
29+
upload_modrinth: ${{ github.event.inputs.upload_modrinth }}
30+
upload_dbo: ${{ github.event.inputs.upload_dbo }}
31+
upload_hangar: ${{ github.event.inputs.upload_hangar }}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: 'Dispatch: Promote Release'
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
target_tag:
7+
description: 'Version to promote'
8+
required: true
9+
10+
jobs:
11+
check_version:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Verify input version is prerelease
15+
run: |
16+
if [[ "${{ github.event.inputs.target_tag }}" != *"pre"* ]]; then
17+
echo "Version must be a prerelease"
18+
exit 1
19+
fi
20+
21+
github_release:
22+
needs: check_version
23+
uses: ./.github/workflows/call.github_release.yml
24+
secrets: inherit
25+
with:
26+
release_mode: promote
27+
promote_from: ${{ github.event.inputs.target_tag }}
28+
29+
platform_uploads:
30+
needs: github_release
31+
if: needs.github_release.outputs.release_created == 'true'
32+
uses: ./.github/workflows/call.platform_uploads.yml
33+
secrets: inherit
34+
with:
35+
target_tag: ${{ needs.github_release.outputs.tag_name }}
36+
upload_modrinth: 'true'
37+
upload_dbo: 'true'
38+
upload_hangar: 'true'

.github/workflows/main.prerelease.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: 'Main: Prerelease'
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
github_release_on_push:
9+
uses: ./.github/workflows/call.github_release.yml
10+
secrets: inherit
11+
with:
12+
release_mode: prerelease
13+
version_bump: prlabel
14+
15+
platform_uploads_on_push:
16+
needs: github_release_on_push
17+
if: needs.github_release_on_push.outputs.release_created == 'true'
18+
uses: ./.github/workflows/call.platform_uploads.yml
19+
secrets: inherit
20+
with:
21+
target_tag: ${{ needs.github_release_on_push.outputs.tag_name }}
22+
upload_modrinth: 'true'
23+
upload_dbo: 'false'
24+
upload_hangar: 'false'

.github/workflows/require_label.yml renamed to .github/workflows/pr.require_label.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Require PR Labels
1+
name: 'PR: Require Label'
22

33
on:
44
pull_request:
@@ -15,4 +15,4 @@ jobs:
1515
with:
1616
mode: exactly
1717
count: 1
18-
labels: "release:major, release:minor, release:patch, no version bump"
18+
labels: "release:major, release:minor, release:patch, no release"

.github/workflows/pr.test.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: 'PR: Test'
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
7+
jobs:
8+
test:
9+
uses: Multiverse/Multiverse-Core/.github/workflows/generic.test.yml@main
10+
with:
11+
plugin_name: multiverse-portals

.github/workflows/pr_labeler.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/workflows/promote_release.yml

Lines changed: 0 additions & 88 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)