forked from Fx-Costa/SpeedRunPlus
-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (104 loc) · 3.55 KB
/
Copy pathdeploy.yml
File metadata and controls
111 lines (104 loc) · 3.55 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
name: Deploy Release
on:
workflow_dispatch:
inputs:
version:
description: The version to deploy
type: choice
options:
- 1.2.0-SNAPSHOT
- 1.1.0
- 1.1.0-SNAPSHOT
- 1.0.0
- 1.0.0-SNAPSHOT
- 0.0.0
publish-modrinth:
description: Publish to Modrinth
type: boolean
default: false
publish-hangar:
description: Publish to Hangar
type: boolean
default: false
env:
ASSET_NAME: ''
jobs:
deploy:
runs-on: ubuntu-latest
steps:
# Set the asset name based on version input
- name: Set asset name
run: |
echo "ASSET_NAME=srp-${{ github.event.inputs.version }}.jar" >> $GITHUB_ENV
# Download release asset from GitHub Releases
- name: Fetch GitHub release info
id: release_info
uses: KevinRohn/github-full-release-data@v2.0.7
with:
token: ${{ secrets.CI_CD_PAT }}
version: ${{ github.event.inputs.version }}
body-markdown-file-path: ./CHANGELOG.md
asset-file: ${{ env.ASSET_NAME }}
asset-output: .
# Deploy via SFTP
- name: Deploy via SFTP
uses: wlixcc/SFTP-Deploy-Action@v1.2.4
with:
username: ${{ secrets.SFTP_USERNAME }}
server: ${{ secrets.SFTP_HOST }}
password: ${{ secrets.SFTP_PASSWORD }}
port: ${{ secrets.SFTP_PORT }}
local_path: "./${{ env.ASSET_NAME }}"
remote_path: '/plugins/'
sftp_only: true
ssh_private_key: ''
- name: Publish to Modrinth
if: ${{ github.event.inputs.publish-modrinth == 'true' }}
uses: RubixDev/modrinth-upload@v1
with:
token: ${{ secrets.MODRINTH_TOKEN }}
file_path: "./${{ env.ASSET_NAME }}"
name: "SpeedRun+ | ${{ github.event.inputs.version }}"
version: ${{ github.event.inputs.version }}
changelog: ${{ fromJSON(steps.release_info.outputs.body) }}
relations: 3wmN97b8:required,vtawPsTo:required
game_versions: 1.16.1
release_type: ${{ contains(github.event.inputs.version, '-SNAPSHOT') && 'beta' || 'release' }}
loaders: paper,bukkit,spigot
featured: true
project_id: alRlV7Gp
- name: Publish to Hangar
if: ${{ github.event.inputs.publish-hangar == 'true' }}
uses: benwoo1110/hangar-upload-action@v1
with:
api_token: ${{ secrets.HANGAR_TOKEN }}
slug: SpeedRunPlus
version: "${{ github.event.inputs.version }}"
channel: ${{ contains(github.event.inputs.version, '-SNAPSHOT') && 'Snapshot' || 'Release' }}
files: |
[
{
"path": "./${{ env.ASSET_NAME }}",
"platforms": ["PAPER"]
}
]
description: ${{ fromJSON(steps.release_info.outputs.body) }}
plugin_dependencies: |
{
"PAPER": [
{
"name": "Multiverse-Core",
"required": true,
"externalUrl": "https://hangar.papermc.io/Multiverse/Multiverse-Core/versions/4.3.16"
},
{
"name": "Multiverse-NetherPortals",
"required": true,
"externalUrl": "https://hangar.papermc.io/Multiverse/Multiverse-NetherPortals/versions/4.2.3"
}
]
}
platform_dependencies: |
{
"PAPER": ["1.16.1"]
}