diff --git a/.github/workflows/mingw-cross.yml b/.github/workflows/mingw-cross.yml index 65452a403..89feb862b 100644 --- a/.github/workflows/mingw-cross.yml +++ b/.github/workflows/mingw-cross.yml @@ -13,4 +13,29 @@ jobs: - name: Run build run: | - docker build -f docker/WindowsDockerfile . + ./easy-compile-docker-windows + ./easy-release-windows + + - name: Archive Folder + uses: actions/upload-artifact@v2 + with: + name: artifact + path: ${{github.workspace}}/*.zip + + publish-release: + needs: build + runs-on: ubuntu-latest + + steps: + - name: Download Artifact + uses: actions/download-artifact@v2 + with: + name: artifact + path: ${{github.workspace}} + + - name: Create Release + id: create_release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: ${{ github.workspace }}/*.zip diff --git a/easy-release-windows b/easy-release-windows new file mode 100755 index 000000000..e891cbe4b --- /dev/null +++ b/easy-release-windows @@ -0,0 +1,33 @@ +#!/bin/bash + +EXEDIR=`pwd` +EXE=paintown.exe + +# inside tmp +cd `mktemp -d` + +# copy executable +cp $EXEDIR/mingw-bin/$EXE . +# copy dependencies +docker run --rm -iv `pwd`:/paintown-bin -w /paintown-bin paintown-mingw-build bash -c "cp /usr/x86_64-w64-mingw32/lib/zlib1.dll ." + +# launcher +echo ' +if (-not (Test-Path -Path data)) { + Invoke-WebRequest -Uri "https://github.com/kazzmir/paintown/releases/download/v3.6.0/data-3.6.0.zip" -OutFile "data.zip" + Expand-Archive -Path "data.zip" -DestinationPath . + Remove-Item -Path data.zip + Rename-Item -Path data-3.6.0 -NewName data +} +Start-Process -FilePath paintown.exe +' > paintown.ps1 +echo ' +powershell.exe -ExecutionPolicy Bypass -File paintown.ps1 +' > run.bat + +file $EXE + +# packaging +ARCH=`file paintown.exe | grep -o -E 'x86[_-]64|i[[:digit:]]86|ARM'` +OS=windows +zip -r $EXEDIR/$EXE-$OS-$ARCH.zip . \ No newline at end of file