fixed CI build failing on windows #126
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
name: Build binaries | |
on: | |
push: | |
branches: [ "main" ] | |
paths: | |
- CHANGES.md | |
- .github/workflows/** | |
permissions: | |
write-all | |
jobs: | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Checkout submodules | |
run: git submodule update --init --recursive | |
- name: Add MSBuild to PATH | |
uses: microsoft/[email protected] | |
- name: Build | |
working-directory: ${{env.GITHUB_WORKSPACE}} | |
# Add additional options to the MSBuild command line here (like platform or verbosity level). | |
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference | |
run: | | |
./setup.ps1 CI_BUILD | |
- name: package | |
run: | | |
mkdir Release | |
cp -r -force ./EditorContent Release/EditorContent | |
cp -r -force ./CSharp Release/CSharp | |
cp -r -force ./Tools Release/Tools | |
cp -r -force ./ProjectGenerator.exe Release | |
cp -r -force ./Docs Release/Docs | |
- name: upload artifact | |
uses: actions/upload-artifact@v3 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
path: Release | |
name: Klemmgine-Windows-${{ github.run_number }}.zip | |
build-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Checkout submodules | |
run: git submodule update --init --recursive | |
- name: install dependencies | |
run: | | |
sudo apt update | |
sudo apt autoremove --purge snapd | |
sudo apt-get install libsdl2-dev | |
sudo apt-get install libglew-dev | |
sudo apt-get install libopenal-dev | |
cd Dependencies | |
git clone https://github.com/Klemmbaustein/KlemmBuild.git --recurse-submodules | |
cd KlemmBuild | |
sudo make install | |
- name: build | |
run: | | |
chmod +x setup.sh | |
./setup.sh CI_BUILD | |
- name: install doxygen | |
run: | | |
wget https://www.doxygen.nl/files/doxygen-1.10.0.linux.bin.tar.gz | |
tar -xf doxygen-1.10.0.linux.bin.tar.gz | |
cd doxygen-1.10.0 | |
sudo make | |
- name: make-release | |
run: | | |
doxygen | |
mkdir Release | |
cp -rf ./EditorContent Release/EditorContent | |
cp -rf ./CSharp Release/CSharp | |
cp -rf ./Tools Release/Tools | |
cp -rf ./ProjectGenerator Release | |
cp -rf ./Docs Release/Docs | |
- name: upload artifact | |
uses: actions/upload-artifact@v3 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
path: Release | |
name: Klemmgine-Linux-${{ github.run_number }} | |
Release: | |
runs-on: ubuntu-latest | |
needs: [ build-windows, build-linux ] | |
steps: | |
- name: Retrieve Release Artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
path: Release | |
- name: compress artifacts | |
run: | | |
cd ${{ github.workspace }}/Release/Klemmgine-Windows-${{ github.run_number }}.zip | |
zip -r ${{ github.workspace }}/klemmgine-win.zip ./* | |
export LINUX_ARTIFACT_NAME=${{ github.workspace }}/Release/Klemmgine-Linux-${{ github.run_number }} | |
cd $LINUX_ARTIFACT_NAME | |
chmod +x ProjectGenerator | |
chmod +x Tools/ProjectGenerator/LinuxFiles/Editor.sh | |
cd .. | |
tar -czf ${{ github.workspace }}/klemmgine-linux.tar.gz Klemmgine-Linux-${{ github.run_number }} | |
- name: list-directory | |
run: ls -R | |
- name: Create release | |
uses: actions/create-release@v1 | |
id: create_release | |
with: | |
draft: false | |
prerelease: false | |
release_name: "Build #${{ github.run_number }}" | |
tag_name: Build-${{ github.run_number }} | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
- name: upload linux artifact | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: klemmgine-linux.tar.gz | |
asset_name: Klemmgine-Linux-${{ github.run_number }}.tar.gz | |
asset_content_type: application/zip | |
- name: upload windows artifact | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: klemmgine-win.zip | |
asset_name: Klemmgine-Windows-${{ github.run_number }}.zip | |
asset_content_type: application/zip |