|
| 1 | +name: Testbuild for x86 and x86_64 Windows |
| 2 | +run-name: testbuild_windows |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - 'master' |
| 7 | + pull_request: |
| 8 | + types: |
| 9 | + - edited |
| 10 | + - opened |
| 11 | + - synchronize |
| 12 | +concurrency: |
| 13 | + # Cancel concurrent workflows for the same PR or commit hash. |
| 14 | + group: ${{github.workflow}}-${{github.event_name == 'pull_request' && github.head_ref || github.sha}} |
| 15 | + cancel-in-progress: true |
| 16 | +jobs: |
| 17 | + build_win_x86_msvc: |
| 18 | + runs-on: windows-latest |
| 19 | + defaults: |
| 20 | + run: |
| 21 | + # use git bash for for all steps (unless specified otherwise per step) |
| 22 | + shell: bash |
| 23 | + strategy: |
| 24 | + fail-fast: false |
| 25 | + steps: |
| 26 | + - name: Install build dependencies |
| 27 | + run: | |
| 28 | + cd .. |
| 29 | + - name: Check out repository code |
| 30 | + uses: actions/checkout@v4 |
| 31 | + - name: Build |
| 32 | + run: | |
| 33 | + # build with cmake and visual studio |
| 34 | + cmake -A Win32 -S ../ -B build |
| 35 | + time cmake --build build/ --config Release |
| 36 | + - name: Create testbuild package |
| 37 | + run: | |
| 38 | + # Create release directory tree |
| 39 | + export PKGDIR="librecoop-win32-$(git rev-parse --short HEAD)" |
| 40 | + echo "pkgname=$PKGDIR" >> $GITHUB_ENV |
| 41 | + cd build/Release |
| 42 | + cp librecoop.dll librecoopd3xp.dll ../../publish/$PKGDIR/ |
| 43 | + cd ../.. |
| 44 | + # Copy misc assets |
| 45 | + cp COPYING.txt publish/$PKGDIR/ |
| 46 | + echo "Librecoop for 32bit (x86) Windows, built $(date)" > publish/$PKGDIR/README.txt |
| 47 | + echo -e "from ${{ github.ref_name }} commit ${{ github.sha }}\n" >> publish/$PKGDIR/README.txt |
| 48 | + cat README.md >> publish/$PKGDIR/README.txt |
| 49 | + cd - |
| 50 | + - name: Upload testbuild package |
| 51 | + uses: actions/upload-artifact@v4 |
| 52 | + with: |
| 53 | + name: ${{ env.pkgname }} |
| 54 | + path: publish/ |
| 55 | + if-no-files-found: error |
| 56 | + build_win_x86_64_msvc: |
| 57 | + runs-on: windows-latest |
| 58 | + defaults: |
| 59 | + run: |
| 60 | + # use git bash for for all steps (unless specified otherwise per step) |
| 61 | + shell: bash |
| 62 | + strategy: |
| 63 | + fail-fast: false |
| 64 | + steps: |
| 65 | + - name: Install build dependencies |
| 66 | + run: | |
| 67 | + cd .. |
| 68 | + - name: Check out repository code |
| 69 | + uses: actions/checkout@v4 |
| 70 | + - name: Build |
| 71 | + run: | |
| 72 | + # build with cmake and visual studio |
| 73 | + #echo $PWD # /d/a/dhewm3/dhewm3 |
| 74 | + # NOTE: not setting -G "Visual Studio 17 2022" so it just uses the default VS version it can find |
| 75 | + cmake -A x64 -S ../ -B build |
| 76 | + time cmake --build build/ --config Release |
| 77 | + - name: Create testbuild package |
| 78 | + run: | |
| 79 | + # Create release directory tree |
| 80 | + export PKGDIR="librecoop-win64-$(git rev-parse --short HEAD)" |
| 81 | + echo "pkgname=$PKGDIR" >> $GITHUB_ENV |
| 82 | + cd build/Release |
| 83 | + cp librecoop.dll librecoopd3xp.dll ../../publish/$PKGDIR/ |
| 84 | + cd ../.. |
| 85 | + echo "librecoop for 64bit (amd64 aka x86_64 aka x64) Windows, built $(date)" > publish/$PKGDIR/README.txt |
| 86 | + echo -e "from ${{ github.ref_name }} commit ${{ github.sha }}\n" >> publish/$PKGDIR/README.txt |
| 87 | + cat README.md >> publish/$PKGDIR/README.txt |
| 88 | + cd - |
| 89 | + - name: Upload testbuild package |
| 90 | + uses: actions/upload-artifact@v4 |
| 91 | + with: |
| 92 | + name: ${{ env.pkgname }} |
| 93 | + path: publish/ |
| 94 | + if-no-files-found: error |
0 commit comments