-
Notifications
You must be signed in to change notification settings - Fork 4
134 lines (112 loc) · 4.28 KB
/
ksp-publish.yml
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Build and Release
on: [ push ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Setup .NET Core SDK
uses: actions/[email protected]
with:
dotnet-version: '6.0.x'
- name: Install Python Tools
run: |
python -m pip install --upgrade pip
python -m pip install yaclog yaclog-ksp
- name: Generate Version Info
run: |
echo "VERSION_TITLE=$(yaclog show -n)" >> $GITHUB_ENV
python Scripts/version.py
yaclog-ksp -n "Conformal Decals"
- name: Validate Version Info
uses: DasSkelett/AVC-VersionFileValidator@master
- name: Download DLL Dependencies
working-directory: Source
run: |
wget --user drewcassidy --password ${{ secrets.PILE_OF_ROCKS_PASS }} https://pileof.rocks/Secret/conformal-decals-dependencies-1.zip
unzip conformal-decals-dependencies-*.zip -d ConformalDecals/dlls
- name: Build DLL
working-directory: Source
run: |
mkdir -p ../GameData/ConformalDecals/Plugins
dotnet build --configuration Release ConformalDecals.sln
- name: Download KSP Dependencies
run: |
wget https://pileof.rocks/KSP/Shabby_v0.3.0.zip
wget https://ksp.sarbian.com/jenkins/job/ModuleManager/161/artifact/ModuleManager.4.2.1.dll
wget https://github.com/blowfishpro/B9PartSwitch/releases/download/v2.19.0/B9PartSwitch_v2.19.0.zip
wget https://github.com/KSPModdingLibs/HarmonyKSP/releases/download/2.0.4.0/HarmonyKSP_2.0.4.0_for_KSP1.8+.zip
unzip -d Shabby Shabby*.zip
unzip -d B9PartSwitch B9PartSwitch*.zip
unzip -d HarmonyKSP HarmonyKSP*.zip
mv Shabby/GameData/Shabby GameData/
mv ModuleManager*.dll GameData/
mv B9PartSwitch/GameData/B9PartSwitch GameData/
mv HarmonyKSP/GameData/000_Harmony GameData/
- name: Upload Unbundled Build
uses: actions/upload-artifact@v4
with:
name: ConformalDecals-unbundled
path: |
GameData/ConformalDecals/
README.md
CHANGELOG.md
LICENSE-ART.md
LICENSE-SOURCE.md
- name: Upload Bundled Build
uses: actions/upload-artifact@v4
with:
name: ConformalDecals
path: |
GameData/
README.md
CHANGELOG.md
LICENSE-ART.md
LICENSE-SOURCE.md
deploy:
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Python Tools
run: |
python -m pip install --upgrade pip
python -m pip install yaclog
- name: Download Build Artifacts
uses: actions/download-artifact@v4
- name: Zip Download Packages
run: |
mkdir bundled
mkdir unbundled
zip -r bundled/ConformalDecals-$VERSION_TITLE.zip ConformalDecals/*
zip -r unbundled/ConformalDecals-$VERSION_TITLE.zip ConformalDecals-unbundled/*
ls
- name: Publish to Spacedock
run: |
curl -F "username=drewcassidy" -F "password=${{ secrets.SPACEDOCK_PASS }}" \
-c ./cookies "https://spacedock.info/api/login"
curl -c ./cookies -b ./cookies \
-F "version=$VERSION_TITLE" \
-F "changelog=$(yaclog show -mb)" \
-F "game-version=1.12.3" \
-F "notify-followers=yes" \
-F "zipball=@bundled/ConformalDecals-$VERSION_TITLE.zip" \
"https://spacedock.info/api/mod/2451/update"
- name: Publish to Github
run: |
gh release create ${{ github.ref_name }} \
--notes "$(yaclog show -mb)" \
--title "Version $(yaclog show -n)" \
bundled/ConformalDecals-*.zip \
ConformalDecals/GameData/ConformalDecals/Versioning/ConformalDecals.version
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}