Skip to content

v17.11.0.0

v17.11.0.0 #90

name: "Attach Release Artifacts"
# Controls when the action will run.
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:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Get Branch
shell: bash
run: |
releaseBranch=${{ github.event.release.target_commitish }}
echo "Found branch ${releaseBranch}"
echo "tagged_branch=${releaseBranch}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ env.tagged_branch }}
- name: Download required assemblies
id: download-assemblies
uses: KSP-RO/BuildTools/download-assemblies-v2@master
with:
KSP_ZIP_PASSWORD: ${{ secrets.KSP_ZIP_PASSWORD }}
dependency-identifiers: |
Harmony2
ROUtils
RealFuels
- name: Update AssemblyInfo
uses: KSP-RO/BuildTools/update-assembly-info@master
with:
path: ${{ github.workspace }}/Source/Properties/AssemblyInfo.cs
tag: ${{ github.event.release.tag_name }}
- name: Build mod solution
shell: bash
env:
TAG_STRING: ${{ github.event.release.tag_name }}
run: |
msbuild /restore /p:RestorePackagesConfig=true /p:Configuration=Release /p:ReferencePath="${{ steps.download-assemblies.outputs.ksp-dll-path }}" ${{ github.workspace }}/Source/RealismOverhaul.sln /p:KSPRoot="${{ env.KSP_ROOT }}"
msbuild /p:Configuration=Release /p:ReferencePath="${{ steps.download-assemblies.outputs.ksp-dll-path }}" ${{ github.workspace }}/Source/KerbalPlugins.EngineGroupController.sln /p:KSPRoot="${{ env.KSP_ROOT }}"
cp -v ${{ github.workspace }}/Source/obj/Release/RealismOverhaul.dll ${{ github.workspace }}/GameData/RealismOverhaul/Plugins/RealismOverhaul.dll
cp -v ${{ github.workspace }}/Source/InstallChecker/obj/Release/ROInstallChecker.dll ${{ github.workspace }}/GameData/RealismOverhaul/Plugins/ROInstallChecker.dll
cp -v ${{ github.workspace }}/Source/EngineGroupController/obj/Release/EngineGroupController.dll ${{ github.workspace }}/GameData/EngineGroupController/Plugins/EngineGroupController.dll
cp -v ${{ github.workspace }}/Source/UnityGUIFramework/obj/Release/UnityGUIFramework.dll ${{ github.workspace }}/GameData/EngineGroupController/Plugins/UnityGUIFramework.dll
- name: Remove excess DLLs
uses: KSP-RO/BuildTools/remove-excess-dlls@master
with:
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/RealismOverhaul/RO.version
- name: Update Readme
uses: KSP-RO/BuildTools/update-version-in-readme@master
with:
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/RealismOverhaul/changelog.cfg
- name: Assemble release
id: assemble-release
run: |
RELEASE_DIR="${RUNNER_TEMP}/release"
echo "Release dir: ${RELEASE_DIR}"
echo "Release zip: ${RELEASE_DIR}/RealismOverhaul-${{ github.event.release.tag_name }}.zip"
mkdir -v "${RELEASE_DIR}"
echo "::set-output name=release-dir::${RELEASE_DIR}"
cp -v -R "${{ github.workspace }}/Ships" "${RELEASE_DIR}"
cp -v -R "${{ github.workspace }}/GameData" "${RELEASE_DIR}"
cp -v "${{ github.workspace }}/README.md" "${RELEASE_DIR}/README.md"
cd ${RELEASE_DIR}
zip -r RealismOverhaul-${{ github.event.release.tag_name }}.zip GameData Ships README.md
- name: Upload package to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ steps.assemble-release.outputs.release-dir }}/RealismOverhaul-${{ github.event.release.tag_name }}.zip
asset_name: RealismOverhaul-${{ github.event.release.tag_name }}.zip
asset_content_type: application/zip
- name: Setup git config
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- name: Commit new version file
shell: bash
env:
TAG_STRING: ${{ github.event.release.tag_name }}
run: |
RELEASEBRANCH=${{ env.tagged_branch }}
git add "${{ github.workspace }}/GameData/RealismOverhaul/RO.version"
git add "${{ github.workspace }}/README.md"
git add "${{ github.workspace }}/GameData/RealismOverhaul/changelog.cfg"
git commit -m "Update version to $TAG_STRING"
git push origin $RELEASEBRANCH
git tag $TAG_STRING $RELEASEBRANCH --force
git push origin $TAG_STRING --force