Skip to content

Commit 4039099

Browse files
Kade-NRosalie241
authored andcommitted
Add workflow to upload to update.launcherkit.sporecommunity.com
1 parent 9c3eb1e commit 4039099

File tree

1 file changed

+41
-2
lines changed

1 file changed

+41
-2
lines changed

.github/workflows/build.yml

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,45 @@ jobs:
105105
draft: true
106106
makeLatest: true
107107
tag: ${{ env.GIT_REVISION }}
108-
artifacts: |
109-
artifact/*
108+
artifacts: artifact/*
109+
release-cloudflare:
110+
runs-on: windows-2022
111+
needs: [ build ]
112+
if: github.ref_type == 'tag'
113+
steps:
114+
- uses: actions/checkout@v4
115+
with:
116+
fetch-depth: 0
117+
- name: Prepare Environment
118+
run: |
119+
$env:revision = git describe --tags --always
120+
echo "GIT_REVISION=$env:revision" >> $env:GITHUB_ENV
121+
- name: Download ModApi.Updater
122+
uses: actions/download-artifact@v4
123+
with:
124+
name: ModApi.Updater-${{ env.GIT_REVISION }}
125+
path: artifact
126+
- name: Generate update.info
127+
run: |
128+
$updaterVersion = "1.0.0.0"
129+
$version = (($env:GIT_REVISION -split '\.')[0] -split 'v')[1] + "." `
130+
+ (($env:GIT_REVISION -split '\.')[1]) + "." `
131+
+ (($env:GIT_REVISION -split '\.')[2] -split '-')[0] + ".0"
132+
$downloadUrl = "https://update.launcherkit.sporecommunity.com//releases/latest/download/ModAPIUpdateSetup.exe"
133+
134+
echo $updaterVersion > update.info
135+
echo $version >> update.info
136+
echo "false" >> update.info
137+
echo $downloadUrl >> update.info
138+
139+
Copy update.info artifact/update.info
140+
- name: Upload to Cloudflare R2
141+
uses: ryand56/r2-upload-action@1.4
142+
with:
143+
r2-account-id: ${{ secrets.R2_ACCOUNT_ID }}
144+
r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }}
145+
r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }}
146+
r2-bucket: spore-modapi-launcherkit
147+
source-dir: artifact
148+
destination-dir: ./
110149

0 commit comments

Comments
 (0)