KSP-Conformal-Decals/.github/workflows/ksp-publish.yml

138 lines
4.4 KiB
YAML
Raw Normal View History

2022-03-07 07:17:38 +00:00
name: build
on: [ push ]
2022-03-07 07:17:38 +00:00
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v1.7.2
with:
dotnet-version: '6.0.x'
2022-03-10 05:22:05 +00:00
- name: Install Python Tools
2022-03-07 07:17:38 +00:00
run: |
python -m pip install --upgrade pip
python -m pip install yaclog yaclog-ksp
2022-03-10 05:22:05 +00:00
- name: Generate Version Info
run: |
2022-03-11 03:05:26 +00:00
echo "VERSION_TITLE=$(yaclog show -n)" >> $GITHUB_ENV
python Scripts/version.py
2022-03-10 05:22:05 +00:00
yaclog-ksp -n "Conformal Decals"
2022-03-10 05:22:05 +00:00
- name: Validate Version Info
uses: DasSkelett/AVC-VersionFileValidator@master
2022-03-07 07:17:38 +00:00
2022-03-09 07:43:33 +00:00
- name: Download DLL Dependencies
2022-03-07 07:17:38 +00:00
working-directory: Source
run: |
2022-03-07 07:23:39 +00:00
wget --user drewcassidy --password ${{ secrets.PILE_OF_ROCKS_PASS }} https://pileof.rocks/Secret/conformal-decals-dependencies-1.zip
2022-03-07 07:42:51 +00:00
unzip conformal-decals-dependencies-*.zip -d ConformalDecals/dlls
dotnet build --configuration Release ConformalDecals.sln
2022-03-07 07:17:38 +00:00
- name: Build DLL
2022-03-07 07:17:38 +00:00
working-directory: Source
run: |
2022-03-07 08:28:00 +00:00
mkdir -p ../GameData/ConformalDecals/Plugins
2022-03-07 08:06:16 +00:00
dotnet build --configuration Release ConformalDecals.sln
- name: Download KSP Dependencies
run: |
wget http://pileof.rocks/KSP/Shabby_v0.2.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
unzip -d Shabby Shabby*.zip
unzip -d B9PartSwitch B9PartSwitch*.zip
mv Shabby/GameData/Shabby GameData/
2022-03-10 05:00:27 +00:00
mv ModuleManager*.dll GameData/
mv B9PartSwitch/GameData/B9PartSwitch GameData/
2022-03-07 08:08:43 +00:00
- name: Upload Unbundled Build
2022-03-07 08:06:16 +00:00
uses: actions/upload-artifact@v3
with:
2022-03-10 05:53:46 +00:00
name: ConformalDecals-unbundled
path: |
GameData/ConformalDecals
README.md
CHANGELOG.md
LICENSE-ART.md
LICENSE-SOURCE.md
- name: Upload Bundled Build
uses: actions/upload-artifact@v3
with:
2022-03-10 05:53:46 +00:00
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@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
2022-03-10 05:22:05 +00:00
- name: Install Python Tools
run: |
python -m pip install --upgrade pip
2022-03-10 04:58:17 +00:00
python -m pip install yaclog
2022-03-10 05:22:05 +00:00
2022-03-10 05:53:46 +00:00
- name: Get version name and body
run: |
2022-03-11 03:05:26 +00:00
echo "VERSION_TITLE=$(yaclog show -n)" >> $GITHUB_ENV
2022-03-10 05:53:46 +00:00
echo "$(yaclog show -mb)" >> RELEASE.md
2022-03-10 05:22:05 +00:00
- name: Download Build Artifacts
uses: actions/download-artifact@v3
- name: Zip Download Packages
run: |
2022-03-10 06:03:06 +00:00
mkdir bundled
mkdir unbundled
zip -r bundled/ConformalDecals-$VERSION_TITLE.zip ConformalDecals/*
zip -r unbundled/ConformalDecals-$VERSION_TITLE.zip ConformalDecals-unbundled/*
2022-03-10 05:22:05 +00:00
ls
- name: Publish to Spacedock
run: |
2022-03-10 06:05:26 +00:00
curl -F "username=drewcassidy" -F "password=${{ secrets.SPACEDOCK_PASS }}" \
-c ./cookies "https://spacedock.info/api/login"
curl -c ./cookies -b ./cookies \
2022-03-10 05:53:46 +00:00
-F "version=$VERSION_TITLE" \
-F "changelog=$(yaclog show -mb)" \
-F "game-version=1.12.3" \
-F "notify-followers=yes" \
2022-03-10 06:07:32 +00:00
-F "zipball=@bundled/ConformalDecals-$VERSION_TITLE.zip" \
"https://spacedock.info/api/mod/2994/update"
- name: Publish to Github
uses: softprops/action-gh-release@v1
with:
files: |
bundled/ConformalDecals-*.zip
ConformalDecals/GameData/ConformalDecals/Versioning/ConformalDecals.version
2022-03-11 03:05:26 +00:00
name: ${{ env.VERSION_TITLE }}
body_path: RELEASE.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}