Skip to content

Commit 30c8cac

Browse files
committed
Update to use KSPBT create-release workflow
1 parent 1802524 commit 30c8cac

2 files changed

Lines changed: 42 additions & 54 deletions

File tree

.github/workflows/release.yml

Lines changed: 14 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,21 @@
11
name: Release
22

33
on:
4-
release:
5-
types: [published]
6-
pull_request:
7-
paths:
8-
- .github/workflows/release.yml
4+
workflow_dispatch:
5+
inputs:
6+
version-string:
7+
description: 'Version (e.g. 0.8.3) or one of --major / --minor / --patch to bump from CHANGELOG.md'
8+
required: true
9+
default: --patch
10+
type: string
911

1012
jobs:
11-
build:
12-
uses: KSPModdingLibs/KSPBuildTools/.github/workflows/build.yml@1.1.1
13-
with:
14-
artifacts:
15-
GameData Extras LICENSE* README* CHANGELOG*
16-
17-
assemble-release-assets:
18-
needs: build
19-
runs-on: ubuntu-latest
13+
release:
2014
permissions:
2115
contents: write
22-
steps:
23-
- uses: actions/download-artifact@v8
24-
with:
25-
name: SystemHeat-Release
26-
path: SystemHeat
27-
28-
- name: Copy Version File
29-
run: |
30-
cp SystemHeat/GameData/SystemHeat/Versioning/SystemHeat.version .
31-
32-
- name: Extract Version
33-
run: |
34-
echo "MAJOR=$(cat SystemHeat.version | jq -r .VERSION.MAJOR)" >> "$GITHUB_ENV"
35-
echo "MINOR=$(cat SystemHeat.version | jq -r .VERSION.MINOR)" >> "$GITHUB_ENV"
36-
echo "PATCH=$(cat SystemHeat.version | jq -r .VERSION.PATCH)" >> "$GITHUB_ENV"
37-
38-
- name: Build Release Zip
39-
run: |
40-
cd SystemHeat
41-
zip -9 -r '../SystemHeat_${{env.MAJOR}}_${{env.MINOR}}_${{env.PATCH}}.zip' *
42-
43-
- uses: actions/upload-artifact@v7
44-
with:
45-
name: SystemHeat-${{env.MAJOR}}.${{env.MINOR}}.${{env.PATCH}}
46-
path: SystemHeat_${{env.MAJOR}}_${{env.MINOR}}_${{env.PATCH}}.zip
47-
48-
- uses: actions/upload-artifact@v7
49-
with:
50-
name: SystemHeat.version
51-
path: SystemHeat/GameData/SystemHeat/Versioning/SystemHeat.version
52-
53-
- name: Upload release assets
54-
if: github.event_name == 'release'
55-
env:
56-
GH_TOKEN: ${{ github.token }}
57-
GH_REPO: ${{ github.repository }}
58-
run: |
59-
gh release upload '${{ github.event.release.tag_name }}' \
60-
'SystemHeat_${{env.MAJOR}}_${{env.MINOR}}_${{env.PATCH}}.zip' \
61-
SystemHeat.version
16+
uses: Phantomical/KSPBuildTools/.github/workflows/create-release.yml@release-format-options
17+
with:
18+
version-string: ${{ inputs.version-string }}
19+
artifacts: GameData Extras LICENSE* README* CHANGELOG*
20+
flatten: true
21+
version-file: GameData/SystemHeat/Versioning/SystemHeat.version
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"NAME":"SystemHeat",
3+
"URL":"https://raw.githubusercontent.com/post-kerbin-mining-corporation/SystemHeat/master/GameData/SystemHeat/Versioning/SystemHeat.version",
4+
"DOWNLOAD":"https://github.com/post-kerbin-mining-corporation/SystemHeat",
5+
"VERSION":
6+
{
7+
"MAJOR":@VERSION_MAJOR@,
8+
"MINOR":@VERSION_MINOR@,
9+
"PATCH":@VERSION_PATCH@,
10+
"BUILD":0
11+
},
12+
"KSP_VERSION":
13+
{
14+
"MAJOR":1,
15+
"MINOR":12,
16+
"PATCH":5
17+
},
18+
"KSP_VERSION_MIN":{
19+
"MAJOR":1,
20+
"MINOR":11,
21+
"PATCH":0
22+
},
23+
"KSP_VERSION_MAX":{
24+
"MAJOR":1,
25+
"MINOR":12,
26+
"PATCH":99
27+
}
28+
}

0 commit comments

Comments
 (0)