Skip to content

Commit

Permalink
use the standardized build workflow from kspbuildtools
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyOThan authored Apr 15, 2024
1 parent 426f27b commit 6c9728a
Showing 1 changed file with 10 additions and 57 deletions.
67 changes: 10 additions & 57 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,20 @@
name: build

on:
push:
branches: [ $default-branch ]
branches: [ main ]
paths:
- '**.cs'
- '**/*.cs'
pull_request:
paths:
- '**.cs'
- '**/*.cs'
workflow_dispatch:

env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: .

# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: Release

KSP_DIR: ksp/
workflow_call:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 5.x

- name: Download required assemblies
shell: bash
env:
KSP_ZIP_PASSWORD: ${{ secrets.KSP_ZIP_PASSWORD }}
run: |
wget https://github.com/KSPModStewards/KSPCommon/raw/main/KSP-1.12.5.zip
unzip -P "${KSP_ZIP_PASSWORD}" KSP-1.12.5.zip -d "${{ env.KSP_DIR }}"
- name: Install Dependencies
run: echo "TODO"

- name: Update Version
run: echo "TODO"
# TODO: fetch tag, datetime, etc

- name: Restore NuGet Packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore ${{env.SOLUTION_FILE_PATH}}

- name: Build Mod Solution
working-directory: ${{env.GITHUB_WORKSPACE}}
run: msbuild /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:ReferencePath="${{env.KSP_DIR}}" ${{env.SOLUTION_FILE_PATH}}

- name: Assemble Release
run: echo "TODO"
# TODO: copy license/readme/changelog etc? copy to temp location?

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
# TODO: add version to filename?
name: FreeIva
path: ${GITHUB_WORKSPACE}/GameData
uses: KSPModdingLibs/KSPBuildTools/.github/workflows/build.yml@main
with:
ksp-zip-url: https://github.com/KSPModdingLibs/KSPLibs/raw/main/KSP-1.12.5.zip
secrets:
ksp-zip-password: ${{ secrets.KSP_ZIP_PASSWORD }}

0 comments on commit 6c9728a

Please sign in to comment.