|
1 | 1 | name: Release |
2 | 2 |
|
3 | 3 | 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 |
9 | 11 |
|
10 | 12 | 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: |
20 | 14 | permissions: |
21 | 15 | 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 |
0 commit comments