Skip to content

Commit dd650fc

Browse files
authored
Merge branch 'next' into legacy-support
2 parents 0ae3b2d + 09427ed commit dd650fc

File tree

10 files changed

+85
-57
lines changed

10 files changed

+85
-57
lines changed

.github/actions/setup-ckan/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@ runs:
4545
- name: Install CKAN
4646
shell: bash
4747
run: |
48+
sudo rm -f /var/lib/man-db/auto-update # skip updating man pages, which takes a long time and makes no sense in a CI job
4849
gh release download ${{ inputs.ckan-version }} --repo ${{ inputs.ckan-repo }} --pattern 'ckan*.deb' -O ckan.deb
4950
${{ env.ACT && 'sudo apt update --quiet' }}
50-
sudo apt install --quiet ./ckan.deb ${{ runner.debug && '--verbose-versions' }}
51+
sudo apt install --quiet --no-install-recommends --no-install-suggests ./ckan.deb ${{ runner.debug && '--verbose-versions' }}
5152
ckan version
5253
env:
5354
GH_TOKEN: ${{ github.token }}

.github/workflows/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.backup

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,17 @@ jobs:
5151
submodules: true
5252

5353
# Install CKAN and set up an instance
54-
- uses: KSPModdingLibs/KSPBuildTools/.github/actions/setup-ckan@main
54+
- uses: KSPModdingLibs/KSPBuildTools/.github/actions/setup-ckan@0.0.4
5555
if: ${{ (inputs.use-ckan && inputs.use-msbuild) || inputs.dependency-identifiers }}
5656

5757
# Install any listed CKAN dependencies
58-
- uses: KSPModdingLibs/KSPBuildTools/.github/actions/install-dependencies@main
58+
- uses: KSPModdingLibs/KSPBuildTools/.github/actions/install-dependencies@0.0.4
5959
if: ${{ inputs.dependency-identifiers }}
6060
with:
6161
dependency-identifiers: ${{ inputs.dependency-identifiers }}
6262

6363
# Compile the mod
64-
- uses: KSPModdingLibs/KSPBuildTools/.github/actions/compile@main
64+
- uses: KSPModdingLibs/KSPBuildTools/.github/actions/compile@0.0.4
6565
if: ${{ inputs.use-msbuild }}
6666
with:
6767
build-configuration: ${{ inputs.build-configuration }}
@@ -71,7 +71,7 @@ jobs:
7171
use-nuget-restore: ${{ inputs.use-nuget-restore }}
7272

7373
# Assemble the mod into a release package and upload it as an artifact
74-
- uses: KSPModdingLibs/KSPBuildTools/.github/actions/assemble-release@main
74+
- uses: KSPModdingLibs/KSPBuildTools/.github/actions/assemble-release@0.0.4
7575
with:
7676
artifacts: ${{ inputs.artifacts }}
7777
output-file-name: ${{ github.event.repository.name }}-${{ inputs.build-configuration }}

.github/workflows/create-release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
submodules: true
6565

6666
- name: update-version
67-
uses: KSPModdingLibs/KSPBuildTools/.github/actions/update-version@main
67+
uses: KSPModdingLibs/KSPBuildTools/.github/actions/update-version@0.0.4
6868
with:
6969
version-string: ${{ inputs.version-string }}
7070
template-extension: ${{ inputs.version-template-extension }}
@@ -81,18 +81,18 @@ jobs:
8181
git tag -f -a "$VERSION_STRING" -m "$VERSION_STRING"
8282
8383
# Install CKAN and set up an instance
84-
- uses: KSPModdingLibs/KSPBuildTools/.github/actions/setup-ckan@main
84+
- uses: KSPModdingLibs/KSPBuildTools/.github/actions/setup-ckan@0.0.4
8585
if: ${{ (inputs.use-ckan && inputs.use-msbuild) || inputs.dependency-identifiers }}
8686

8787
# Install any listed CKAN dependencies
88-
- uses: KSPModdingLibs/KSPBuildTools/.github/actions/install-dependencies@main
88+
- uses: KSPModdingLibs/KSPBuildTools/.github/actions/install-dependencies@0.0.4
8989
if: ${{ inputs.dependency-identifiers }}
9090
with:
9191
dependency-identifiers: ${{ inputs.dependency-identifiers }}
9292

9393
- name: compile
9494
if: ${{ inputs.use-msbuild }}
95-
uses: KSPModdingLibs/KSPBuildTools/.github/actions/compile@main
95+
uses: KSPModdingLibs/KSPBuildTools/.github/actions/compile@0.0.4
9696
with:
9797
build-configuration: ${{ inputs.build-configuration }}
9898
ksp-zip-url: ${{ inputs.ksp-zip-url }}
@@ -101,7 +101,7 @@ jobs:
101101

102102
- name: assemble-release
103103
id: assemble-release
104-
uses: KSPModdingLibs/KSPBuildTools/.github/actions/assemble-release@main
104+
uses: KSPModdingLibs/KSPBuildTools/.github/actions/assemble-release@0.0.4
105105
with:
106106
artifacts: ${{ inputs.artifacts }}
107107
output-file-name: ${{ github.event.repository.name }}-${{ env.VERSION_STRING }}

.github/workflows/internal-ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ jobs:
2727
with:
2828
fetch-depth: 0 # get full history, not shallow clone
2929

30+
- name: Check for workflows with outdated action pins
31+
if: startsWith(github.ref, 'refs/tags')
32+
run: |
33+
! grep -P -i 'uses: KSPModdingLibs/KSPBuildTools/\.github/actions/.*@(?!${{ github.ref_name }}$)' .github/workflows/*.yml
34+
3035
- name: Setup .NET
3136
uses: actions/setup-dotnet@v4
3237
with:
Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
1-
name: publish-to-spacedock
2-
3-
on:
4-
workflow_call:
5-
inputs:
6-
spacedock-username:
7-
type: string
8-
required: true
9-
description: Spacedock login username
10-
mod-id:
11-
type: string
12-
required: true
13-
description: ID of the mod we are deploying. Get this from the end of your mod's spacedock URL
14-
release-tag:
15-
type: string
16-
required: false
17-
description: The tag of the release. Will be the same as `inputs.release-tag` unless it was blank.
18-
game-id:
19-
type: string
20-
required: false
21-
default: '3102' # hardcoded to KSP1 gameid. retrieve from https://spacedock.info/api/games
22-
description: ID of the game we are deploying for. This should probably be left as-is for KSP 1.
23-
secrets:
24-
spacedock-password:
25-
required: true
26-
description: Spacedock login password. Store this as a secret!
27-
28-
jobs:
29-
publish-to-spacedock:
30-
runs-on: ubuntu-24.04
31-
steps:
32-
- name: get-release-info
33-
id: get-release-info
34-
uses: KSPModdingLibs/KSPBuildTools/.github/actions/get-release-info@main
35-
with:
36-
release-tag: ${{ inputs.release-tag }}
37-
38-
- name: upload-to-spacedock
39-
uses: KSP2Community/[email protected]
40-
with:
41-
username: ${{ inputs.spacedock-username }}
42-
password: ${{ secrets.spacedock-password }}
43-
game_id: ${{ inputs.game-id }}
44-
mod_id: ${{ inputs.mod-id }}
45-
version: ${{ steps.get-release-info.outputs.version-string }}
46-
zipball: ${{ steps.get-release-info.outputs.artifact-file }}
47-
changelog: ${{ steps.get-release-info.outputs.changelog-file }}
1+
name: publish-to-spacedock
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
spacedock-username:
7+
type: string
8+
required: true
9+
description: Spacedock login username
10+
mod-id:
11+
type: string
12+
required: true
13+
description: ID of the mod we are deploying. Get this from the end of your mod's spacedock URL
14+
release-tag:
15+
type: string
16+
required: false
17+
description: The tag of the release. Will be the same as `inputs.release-tag` unless it was blank.
18+
game-id:
19+
type: string
20+
required: false
21+
default: '3102' # hardcoded to KSP1 gameid. retrieve from https://spacedock.info/api/games
22+
description: ID of the game we are deploying for. This should probably be left as-is for KSP 1.
23+
secrets:
24+
spacedock-password:
25+
required: true
26+
description: Spacedock login password. Store this as a secret!
27+
28+
jobs:
29+
publish-to-spacedock:
30+
runs-on: ubuntu-24.04
31+
steps:
32+
- name: get-release-info
33+
id: get-release-info
34+
uses: KSPModdingLibs/KSPBuildTools/.github/actions/get-release-info@0.0.4
35+
with:
36+
release-tag: ${{ inputs.release-tag }}
37+
38+
- name: upload-to-spacedock
39+
uses: KSP2Community/[email protected]
40+
with:
41+
username: ${{ inputs.spacedock-username }}
42+
password: ${{ secrets.spacedock-password }}
43+
game_id: ${{ inputs.game-id }}
44+
mod_id: ${{ inputs.mod-id }}
45+
version: ${{ steps.get-release-info.outputs.version-string }}
46+
zipball: ${{ steps.get-release-info.outputs.artifact-file }}
47+
changelog: ${{ steps.get-release-info.outputs.changelog-file }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ docs/_build
1111
.DS_Store
1212
.idea
1313
*.user
14+
*.backup

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ All notable changes to this project will be documented in this file
2929
### Actions
3030

3131
- Added the `use-nuget-restore` option to the `compile` action to use the `nuget restore` command, for projects using packages.config files. This allows the `compile` action with default settings to work on any Ubuntu runner image
32+
- Sped up `setup-ckan` action by skipping recommended packages and man-db updates
3233

3334

3435
## 0.0.4 - 2025-06-15

docs/workflows/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ KSPBuildTools provides several reusable workflows for use with Github Actions. T
44

55
For usage, see [Reusing Workflows](https://docs.github.com/en/actions/sharing-automations/reusing-workflows) in the Github docs.
66

7+
```{warning}
8+
Due to a limitation of Github actions, only *tagged releases* have reusable workflows with the correct action version. If you pin a workflow to a branch, or leave your workflow usage unpinned, it may run action versions incompatible with the workflow
9+
```
10+
711
```{toctree}
812
---
913
caption: Contents

justfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
set shell:= ['bash', '-c']
2+
yaclog:= "uv tool run [email protected]"
3+
4+
pin-workflows tag:
5+
sed -E -H -i ".backup" "s|(uses: KSPModdingLibs/KSPBuildTools/\.github/actions/\S+@)\S+|\1{{tag}}|g" .github/workflows/*.yml
6+
7+
release *args:
8+
{{yaclog}} release {{args}}
9+
@just pin-workflows $({{yaclog}} show --version)
10+
git add .github/workflows/*.yml
11+
{{yaclog}} release -c
12+
13+
docs:
14+
uv run --with-requirements docs/requirements.txt --no-project -m sphinx docs/ docs/_build
15+

0 commit comments

Comments
 (0)