From b76664b4642f91e4efb38f0e52391a11fe5b3a7e Mon Sep 17 00:00:00 2001 From: Sebastian Morr Date: Tue, 20 Oct 2020 10:54:33 +0200 Subject: [PATCH] Add Windows build to the CI --- .github/workflows/build.yml | 17 ++++++++--------- .gitignore | 1 + Makefile | 32 +++++++++++++++++--------------- 3 files changed, 26 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index de540a6..72aab71 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,22 +15,21 @@ jobs: container: image: barichello/godot-ci:3.2.3 steps: + - name: Install dependencies + run: apt-get update && apt-get install -y rsync p7zip make - uses: actions/checkout@v2 - name: Setup run: | mkdir -p ~/.local/share/godot/templates mv /root/.local/share/godot/templates/$GODOT_VERSION.stable ~/.local/share/godot/templates/$GODOT_VERSION.stable - name: Linux Build - run: | - mkdir -p build/$PROJECT_NAME-linux - godot --export "Linux" build/$PROJECT_NAME-linux/$PROJECT_NAME - cd build/$PROJECT_NAME-linux - zip -r ../$PROJECT_NAME-linux.zip . + run: make linux - name: MacOS Build - run: | - godot --export "Mac OS" build/$PROJECT_NAME-macos.zip - - name: Install rsync - run: apt-get update && apt-get install -y rsync + run: make macos + - name: Windows Build + run: make windows + - name: Clean up + run: make clean-unzipped - name: Deploy uses: JamesIves/github-pages-deploy-action@3.6.2 with: diff --git a/.gitignore b/.gitignore index 507c9e2..f02a819 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /.import/ /cache/ /dependencies/ +/build/ diff --git a/Makefile b/Makefile index 8736d38..6f7fc81 100644 --- a/Makefile +++ b/Makefile @@ -1,31 +1,33 @@ name = "git-hydra" -all: linux macos windows web +all: linux macos windows linux: - mkdir -p /tmp/$(name)-linux - /usr/bin/godot --export "Linux" "/tmp/$(name)-linux/$(name)" - cd /tmp && zip -r $(name)-linux.zip $(name)-linux + mkdir -p build/$(name)-linux + \godot --export "Linux" "build/$(name)-linux/$(name)" + cd build/$(name)-linux && zip -r ../$(name)-linux.zip . macos: - /usr/bin/godot --export "Mac OS" "/tmp/$(name)-macos.app" - mv "/tmp/$(name)-macos.app" "/tmp/$(name)-macos.zip" + mkdir -p build + \godot --export "Mac OS" "build/$(name)-macos.zip" windows: dependencies/windows/git/ - mkdir -p /tmp/$(name)-windows - /usr/bin/godot --export "Windows" "/tmp/$(name)-windows/$(name).exe" - cp -r --parents dependencies/windows/git/ /tmp/$(name)-windows/ - cd /tmp && zip -r $(name)-windows.zip $(name)-windows + mkdir -p build/$(name)-windows + \godot --export "Windows" "build/$(name)-windows/$(name).exe" + cp -r --parents dependencies/windows/git/ build/$(name)-windows/ + cd build/$(name)-windows && zip -r ../$(name)-windows.zip . -web: - mkdir -p /tmp/$(name)-web - /usr/bin/godot --export "HTML5" "/tmp/$(name)-web/index.html" - cd /tmp && zip -r $(name)-web.zip $(name)-web +clean-unzipped: + cd build && ls | grep -v '\.zip$$' | xargs rm -r + +clean: + rm -rf build dependencies cache # Dependencies: cache/portablegit.7z.exe: + mkdir -p cache wget https://github.com/git-for-windows/git/releases/download/v2.28.0.windows.1/PortableGit-2.28.0-64-bit.7z.exe -O cache/portablegit.7z.exe dependencies/windows/git/: cache/portablegit.7z.exe - wine cache/portablegit.7z.exe -o dependencies/windows/git/ -y + 7zr x cache/portablegit.7z.exe -odependencies/windows/git/ -y