Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ on:
jobs:
build:
uses: KSPModdingLibs/KSPBuildTools/.github/workflows/build.yml@1.1.1
with:
artifacts:
GameData Extras LICENSE* README* CHANGELOG*
61 changes: 61 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Release

on:
release:
types: [published]
pull_request:
paths:
- .github/workflows/release.yml

jobs:
build:
uses: KSPModdingLibs/KSPBuildTools/.github/workflows/build.yml@1.1.1
with:
artifacts:
GameData Extras LICENSE* README* CHANGELOG*

assemble-release-assets:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v8
with:
name: SystemHeat-Release
path: SystemHeat

- name: Copy Version File
run: |
cp SystemHeat/GameData/SystemHeat/Versioning/SystemHeat.version .

- name: Extract Version
run: |
echo "MAJOR=$(cat SystemHeat.version | jq -r .VERSION.MAJOR)" >> "$GITHUB_ENV"
echo "MINOR=$(cat SystemHeat.version | jq -r .VERSION.MINOR)" >> "$GITHUB_ENV"
echo "PATCH=$(cat SystemHeat.version | jq -r .VERSION.PATCH)" >> "$GITHUB_ENV"

- name: Build Release Zip
run: |
cd SystemHeat
zip -9 -r '../SystemHeat_${{env.MAJOR}}_${{env.MINOR}}_${{env.PATCH}}.zip' *

- uses: actions/upload-artifact@v7
with:
name: SystemHeat-${{env.MAJOR}}.${{env.MINOR}}.${{env.PATCH}}
path: SystemHeat_${{env.MAJOR}}_${{env.MINOR}}_${{env.PATCH}}.zip

- uses: actions/upload-artifact@v7
with:
name: SystemHeat.version
path: SystemHeat/GameData/SystemHeat/Versioning/SystemHeat.version

- name: Upload release assets
if: github.event_name == 'release'
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
gh release upload '${{ github.event.release.tag_name }}' \
'SystemHeat_${{env.MAJOR}}_${{env.MINOR}}_${{env.PATCH}}.zip' \
SystemHeat.version
Loading