Skip to content

Commit

Permalink
Update workflows to use CKAN-based dependency installation
Browse files Browse the repository at this point in the history
  • Loading branch information
StonesmileGit committed Jul 16, 2024
1 parent 0bdd8db commit e86e07a
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 19 deletions.
40 changes: 28 additions & 12 deletions .github/workflows/attachReleaseArtifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
release:
types: [published]

env:
KSP_ROOT: /tmp/ksp

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
attach-release-artifacts:
Expand All @@ -28,9 +31,22 @@ jobs:

- name: Download required assemblies
id: download-assemblies
uses: KSP-RO/BuildTools/download-assemblies@master
uses: KSP-RO/BuildTools/download-assemblies-v2@master
with:
KSP_ZIP_PASSWORD: ${{ secrets.KSP_ZIP_PASSWORD }}
dependency-identifiers: |
Harmony2
ClickThroughBlocker
ContractConfigurator
FerramAerospaceResearchContinued
Kerbalism
KSPCommunityFixes
ModularFlightIntegrator
RealAntennas
RealFuels
ROUtils
SolverEngines
ToolbarController
# Install .NET SDKs
- name: Setup .NET Core 3.1
Expand All @@ -45,35 +61,35 @@ jobs:
- name: Update AssemblyInfo
uses: KSP-RO/BuildTools/update-assembly-info@master
with:
path: ${GITHUB_WORKSPACE}/Source/RP0/Properties/AssemblyInfo.cs
path: ${{ github.workspace }}/Source/RP0/Properties/AssemblyInfo.cs
tag: ${{ github.event.release.tag_name }}

- name: Build mod solution
run: msbuild ${GITHUB_WORKSPACE}/Source/RP0.sln /t:build /restore /p:RestorePackagesConfig=true /p:Configuration=Release /p:ReferencePath="${{ steps.download-assemblies.outputs.ksp-dll-path }}"
run: msbuild ${{ github.workspace }}/Source/RP0.sln /t:build /restore /p:RestorePackagesConfig=true /p:Configuration=Release /p:ReferencePath="${{ steps.download-assemblies.outputs.ksp-dll-path }}" /p:KSPRoot="${{ env.KSP_ROOT }}"

- name: Remove excess DLLs
uses: KSP-RO/BuildTools/remove-excess-dlls@master
with:
path: ${GITHUB_WORKSPACE}/GameData/
path: ${{ github.workspace }}/GameData/

- name: Update version file
uses: KSP-RO/BuildTools/update-version-file@master
with:
tag: ${{ github.event.release.tag_name }}
path: ${GITHUB_WORKSPACE}/GameData/RP-1/RP-1.version
path: ${{ github.workspace }}/GameData/RP-1/RP-1.version

- name: Update Readme
uses: KSP-RO/BuildTools/update-version-in-readme@master
with:
path: ${GITHUB_WORKSPACE}/README.md
path: ${{ github.workspace }}/README.md
tag: ${{ github.event.release.tag_name }}

- name: Update changelog file
uses: KSP-RO/BuildTools/process-changelog@master
with:
tag: ${{ github.event.release.tag_name }}
body: ${{ github.event.release.body }}
path: ${GITHUB_WORKSPACE}/GameData/RP-1/changelog.cfg
path: ${{ github.workspace }}/GameData/RP-1/changelog.cfg

- name: Assemble release
id: assemble-release
Expand All @@ -83,8 +99,8 @@ jobs:
echo "Release zip: ${RELEASE_DIR}/RP-1-${{ github.event.release.tag_name }}.zip"
mkdir -v "${RELEASE_DIR}"
echo "::set-output name=release-dir::${RELEASE_DIR}"
cp -v -R "${GITHUB_WORKSPACE}/GameData" "${RELEASE_DIR}"
cp -v -R "${GITHUB_WORKSPACE}/LICENSE.md" "${RELEASE_DIR}/GameData/RP-1/LICENSE.md"
cp -v -R "${{ github.workspace }}/GameData" "${RELEASE_DIR}"
cp -v -R "${{ github.workspace }}/LICENSE.md" "${RELEASE_DIR}/GameData/RP-1/LICENSE.md"
cd ${RELEASE_DIR}
zip -r RP-1-${{ github.event.release.tag_name }}.zip GameData
Expand All @@ -109,9 +125,9 @@ jobs:
TAG_STRING: ${{ github.event.release.tag_name }}
run: |
RELEASEBRANCH=${{ env.tagged_branch }}
git add "${GITHUB_WORKSPACE}/GameData/RP-1/RP-1.version"
git add "${GITHUB_WORKSPACE}/README.md"
git add "${GITHUB_WORKSPACE}/GameData/RP-1/changelog.cfg"
git add "${{ github.workspace }}/GameData/RP-1/RP-1.version"
git add "${{ github.workspace }}/README.md"
git add "${{ github.workspace }}/GameData/RP-1/changelog.cfg"
git commit -m "Update version to $TAG_STRING"
git push origin $RELEASEBRANCH
git tag $TAG_STRING $RELEASEBRANCH --force
Expand Down
30 changes: 23 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
KSP_ROOT: /tmp/ksp

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
check-secret:
Expand All @@ -38,9 +41,22 @@ jobs:

- name: Download required assemblies
id: download-assemblies
uses: KSP-RO/BuildTools/download-assemblies@master
uses: KSP-RO/BuildTools/download-assemblies-v2@master
with:
KSP_ZIP_PASSWORD: ${{ secrets.KSP_ZIP_PASSWORD }}
dependency-identifiers: |
Harmony2
ClickThroughBlocker
ContractConfigurator
FerramAerospaceResearchContinued
Kerbalism
KSPCommunityFixes
ModularFlightIntegrator
RealAntennas
RealFuels
ROUtils
SolverEngines
ToolbarController
- name: Get SHA
id: get-sha
Expand Down Expand Up @@ -70,22 +86,22 @@ jobs:
- name: Update AssemblyInfo
uses: KSP-RO/BuildTools/update-assembly-info@AssemblyInformationalVersion
with:
path: ${GITHUB_WORKSPACE}/Source/RP0/Properties/AssemblyInfo.cs
path: ${{ github.workspace }}/Source/RP0/Properties/AssemblyInfo.cs
tag: "3.0.0.0"
informational-version: ${{env.info_text}}

- name: Build mod solution
run: msbuild ${GITHUB_WORKSPACE}/Source/RP0.sln /t:build /restore /p:RestorePackagesConfig=true /p:Configuration=Release /p:ReferencePath="${{ steps.download-assemblies.outputs.ksp-dll-path }}"
run: msbuild ${{ github.workspace }}/Source/RP0.sln /t:build /restore /p:RestorePackagesConfig=true /p:Configuration=Release /p:ReferencePath="${{ steps.download-assemblies.outputs.ksp-dll-path }}" /p:KSPRoot="${{ env.KSP_ROOT }}"

- name: Remove excess DLLs
uses: KSP-RO/BuildTools/remove-excess-dlls@master
with:
path: ${GITHUB_WORKSPACE}/GameData/
path: ${{ github.workspace }}/GameData/

- name: Build metadata
uses: KSP-RO/BuildTools/update-version-file@master
with:
path: ${GITHUB_WORKSPACE}/GameData/RP-1/RP-1.version
path: ${{ github.workspace }}/GameData/RP-1/RP-1.version
tag: "v3.0.0.0"

- name: Assemble release
Expand All @@ -95,8 +111,8 @@ jobs:
echo "Release dir: ${RELEASE_DIR}"
mkdir -v "${RELEASE_DIR}"
echo "::set-output name=release-dir::${RELEASE_DIR}"
cp -v -R "${GITHUB_WORKSPACE}/GameData" "${RELEASE_DIR}"
cp -v -R "${GITHUB_WORKSPACE}/LICENSE.md" "${RELEASE_DIR}/GameData/RP-1/LICENSE.md"
cp -v -R "${{ github.workspace }}/GameData" "${RELEASE_DIR}"
cp -v -R "${{ github.workspace }}/LICENSE.md" "${RELEASE_DIR}/GameData/RP-1/LICENSE.md"
- name: Upload artifacts
uses: actions/upload-artifact@v1
Expand Down

0 comments on commit e86e07a

Please sign in to comment.