Skip to content

Commit 6027da7

Browse files
committed
Added SpaceDock upload action
1 parent 8751b0f commit 6027da7

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

.github/workflows/release.yml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Upload release
22

3+
env:
4+
SPACEDOCK_MOD_ID: 3301
5+
36
on:
47
release:
58
types: [ "published" ]
@@ -11,23 +14,29 @@ jobs:
1114
steps:
1215
- name: Checkout repository
1316
uses: actions/checkout@v4
17+
with:
18+
lfs: true
1419

1520
- name: Download NuGet
1621
id: download-nuget
17-
run: |
18-
sudo curl -o /usr/local/bin/nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
22+
run: sudo curl -o /usr/local/bin/nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
1923

2024
- name: Install jq
2125
uses: dcarbone/[email protected]
2226

2327
- name: Build the solution
28+
run: dotnet build "CommunityFixes.sln" -c Release
29+
30+
- name: Extract current version
31+
id: get-version
2432
run: |
2533
version=$(jq -r '.version' plugin_template/swinfo.json)
2634
echo "Version is $version"
27-
dotnet build "CommunityFixes.sln" -c Release
35+
echo "version=$version" >> $GITHUB_ENV
2836
echo "release_filename=CommunityFixes-$version.zip" >> $GITHUB_ENV
2937
echo "zip=$(ls -1 dist/CommunityFixes-*.zip | head -n 1)" >> $GITHUB_ENV
3038
echo "upload_url=$(wget -qO- https://api.github.com/repos/$GITHUB_REPOSITORY/releases | jq '.[0].upload_url' | tr -d \")" >> $GITHUB_ENV
39+
wget -qO- https://api.github.com/repos/$GITHUB_REPOSITORY/releases | jq -r '.[0].body' > ./changelog.md
3140
3241
- name: Upload zip to release
3342
uses: shogo82148/[email protected]
@@ -38,3 +47,17 @@ jobs:
3847
asset_path: ${{ env.zip }}
3948
asset_name: ${{ env.release_filename }}
4049
asset_content_type: application/zip
50+
51+
- name: Add Mask
52+
run: echo "::add-mask::${{ secrets.SPACEDOCK_PASSWORD }}"
53+
54+
- name: Update mod on SpaceDock
55+
uses: KSP2Community/[email protected]
56+
with:
57+
username: ${{ secrets.SPACEDOCK_USER }}
58+
password: ${{ secrets.SPACEDOCK_PASSWORD }}
59+
game_id: 22407
60+
mod_id: ${{ env.SPACEDOCK_MOD_ID }}
61+
version: ${{ env.version }}
62+
zipball: ${{ env.zip }}
63+
changelog: ./changelog.md

0 commit comments

Comments
 (0)