Skip to content

Commit 0815c64

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

File tree

1 file changed

+42
-2
lines changed

1 file changed

+42
-2
lines changed

.github/workflows/build.yml

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

0 commit comments

Comments
 (0)