Fix cross-platform injection and launcher compatibility #164
Workflow file for this run
This file contains hidden or 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
| name: Build | |
| on: [push, pull_request] | |
| jobs: | |
| build-windows: | |
| runs-on: windows-2022 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Configure paths | |
| run: | | |
| New-Item -ItemType Directory -Force -Path ./artifacts/release/x64 | |
| New-Item -ItemType Directory -Force -Path ./artifacts/release/x86 | |
| New-Item -ItemType Directory -Force -Path ./artifacts/verbose/x64 | |
| New-Item -ItemType Directory -Force -Path ./artifacts/verbose/x86 | |
| - name: Run Windows regression tests | |
| run: ./tests/windows/run-regressions.ps1 | |
| - name: Build Release | |
| run: | | |
| ./build.ps1 | |
| Copy-Item -Path ./build/windows/x64/release/doorstop.dll -Destination ./artifacts/release/x64/winhttp.dll | |
| Copy-Item -Path ./build/windows/x64/release/.doorstop_version -Destination ./artifacts/release/x64/.doorstop_version | |
| Copy-Item -Path ./build/windows/x86/release/doorstop.dll -Destination ./artifacts/release/x86/winhttp.dll | |
| Copy-Item -Path ./build/windows/x86/release/.doorstop_version -Destination ./artifacts/release/x86/.doorstop_version | |
| Copy-Item -Path ./assets/windows/doorstop_config.ini -Destination ./artifacts/release/x64/doorstop_config.ini | |
| Copy-Item -Path ./assets/windows/doorstop_config.ini -Destination ./artifacts/release/x86/doorstop_config.ini | |
| Copy-Item -Path ./LICENSE -Destination ./artifacts/release/LICENSE | |
| - name: Build Verbose | |
| run: | | |
| ./build.ps1 -with_logging | |
| Copy-Item -Path ./build/windows/x64/release/doorstop.dll -Destination ./artifacts/verbose/x64/winhttp.dll | |
| Copy-Item -Path ./build/windows/x64/release/.doorstop_version -Destination ./artifacts/verbose/x64/.doorstop_version | |
| Copy-Item -Path ./build/windows/x86/release/doorstop.dll -Destination ./artifacts/verbose/x86/winhttp.dll | |
| Copy-Item -Path ./build/windows/x86/release/.doorstop_version -Destination ./artifacts/verbose/x86/.doorstop_version | |
| Copy-Item -Path ./assets/windows/doorstop_config.ini -Destination ./artifacts/verbose/x64/doorstop_config.ini | |
| Copy-Item -Path ./assets/windows/doorstop_config.ini -Destination ./artifacts/verbose/x86/doorstop_config.ini | |
| Copy-Item -Path ./LICENSE -Destination ./artifacts/verbose/LICENSE | |
| - name: Upload Release | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: doorstop_win_release | |
| path: artifacts/release | |
| include-hidden-files: true | |
| - name: Upload Verbose | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: doorstop_win_verbose | |
| path: artifacts/verbose | |
| include-hidden-files: true | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ubuntu:20.04 | |
| env: | |
| XMAKE_ROOT: y | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Configure paths | |
| run: | | |
| bash -c "mkdir -p artifacts/{verbose,release,debug}/{x86,x64}" | |
| - name: Install dependencies | |
| run: apt-get update && apt-get install -y git build-essential libreadline-dev ccache gcc-multilib g++-multilib clang curl | |
| - name: Build Release | |
| run: | | |
| ./build.sh | |
| cp build/linux/x86/release/libdoorstop.so artifacts/release/x86/libdoorstop.so | |
| cp build/linux/x64/release/libdoorstop.so artifacts/release/x64/libdoorstop.so | |
| cp build/linux/x86/release/.doorstop_version artifacts/release/x86/.doorstop_version | |
| cp build/linux/x64/release/.doorstop_version artifacts/release/x64/.doorstop_version | |
| cp assets/nix/run.sh artifacts/release/x86/run.sh | |
| cp assets/nix/run.sh artifacts/release/x64/run.sh | |
| cp LICENSE artifacts/release/LICENSE | |
| - name: Run nix regression tests | |
| run: sh tests/nix/run-regressions.sh build/linux/x64/release/libdoorstop.so | |
| - name: Build Verbose | |
| run: | | |
| ./build.sh -with_logging | |
| cp build/linux/x86/release/libdoorstop.so artifacts/verbose/x86/libdoorstop.so | |
| cp build/linux/x64/release/libdoorstop.so artifacts/verbose/x64/libdoorstop.so | |
| cp build/linux/x64/release/.doorstop_version artifacts/verbose/x86/.doorstop_version | |
| cp build/linux/x86/release/.doorstop_version artifacts/verbose/x64/.doorstop_version | |
| cp assets/nix/run.sh artifacts/verbose/x86/run.sh | |
| cp assets/nix/run.sh artifacts/verbose/x64/run.sh | |
| cp LICENSE artifacts/verbose/LICENSE | |
| - name: Build Debug | |
| run: | | |
| ./build.sh -with_logging -debug | |
| cp build/linux/x86/debug/libdoorstop.so artifacts/debug/x86/libdoorstop.so | |
| cp build/linux/x64/debug/libdoorstop.so artifacts/debug/x64/libdoorstop.so | |
| cp build/linux/x86/debug/.doorstop_version artifacts/debug/x86/.doorstop_version | |
| cp build/linux/x64/debug/.doorstop_version artifacts/debug/x64/.doorstop_version | |
| cp assets/nix/run.sh artifacts/debug/x86/run.sh | |
| cp assets/nix/run.sh artifacts/debug/x64/run.sh | |
| cp LICENSE artifacts/debug/LICENSE | |
| - name: Upload Release | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: doorstop_linux_release | |
| path: artifacts/release | |
| include-hidden-files: true | |
| - name: Upload Verbose | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: doorstop_linux_verbose | |
| path: artifacts/verbose | |
| include-hidden-files: true | |
| - name: Upload Debug | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: doorstop_linux_debug | |
| path: artifacts/debug | |
| include-hidden-files: true | |
| build-macos: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Configure paths | |
| run: | | |
| mkdir -p artifacts/{verbose,release,debug}/universal | |
| - name: Build Release | |
| run: | | |
| ./build.sh | |
| cp build/macosx/universal/release/libdoorstop.dylib artifacts/release/universal/libdoorstop.dylib | |
| cp build/macosx/universal/release/.doorstop_version artifacts/release/universal/.doorstop_version | |
| cp assets/nix/run.sh artifacts/release/universal/run.sh | |
| cp LICENSE artifacts/release/LICENSE | |
| - name: Run macOS interposition smoke test | |
| run: sh tests/nix/run-macos-interpose-smoke.sh build/macosx/universal/release/libdoorstop.dylib | |
| - name: Build Verbose | |
| run: | | |
| ./build.sh -with_logging | |
| cp build/macosx/universal/release/libdoorstop.dylib artifacts/verbose/universal/libdoorstop.dylib | |
| cp build/macosx/universal/release/.doorstop_version artifacts/verbose/universal/.doorstop_version | |
| cp assets/nix/run.sh artifacts/verbose/universal/run.sh | |
| cp LICENSE artifacts/verbose/LICENSE | |
| - name: Build Debug | |
| run: | | |
| ./build.sh -with_logging -debug | |
| cp build/macosx/universal/debug/libdoorstop.dylib artifacts/debug/universal/libdoorstop.dylib | |
| cp build/macosx/universal/debug/.doorstop_version artifacts/debug/universal/.doorstop_version | |
| cp assets/nix/run.sh artifacts/debug/universal/run.sh | |
| cp LICENSE artifacts/debug/LICENSE | |
| - name: Upload Release | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: doorstop_macos_release | |
| path: artifacts/release | |
| include-hidden-files: true | |
| - name: Upload Verbose | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: doorstop_macos_verbose | |
| path: artifacts/verbose | |
| include-hidden-files: true | |
| - name: Upload Debug | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: doorstop_macos_debug | |
| path: artifacts/debug | |
| include-hidden-files: true | |
| collect: | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/master' | |
| needs: | |
| - build-windows | |
| - build-linux | |
| - build-macos | |
| steps: | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Grab version | |
| run: | | |
| VERSION=$(cat artifacts/doorstop_win_release/x86/.doorstop_version) | |
| echo "doorstop_version=$VERSION" >> $GITHUB_ENV | |
| - name: Create zips | |
| run: | | |
| mkdir dist | |
| cd artifacts | |
| zip -r ../dist/doorstop_all_${{ env.doorstop_version }}.zip * | |
| for dir in * | |
| do | |
| (cd ${dir}; zip -r ../../dist/${dir}_${{ env.doorstop_version }}.zip *) | |
| done | |
| - name: Create release | |
| uses: marvinpinto/action-automatic-releases@latest | |
| with: | |
| repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
| automatic_release_tag: "ci" | |
| prerelease: true | |
| title: "CI build" | |
| files: dist/*.zip |