diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3a04095dd52..4833dc42203 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -69,13 +69,6 @@ jobs: opam install haxe --deps-only opam list - # required to be able to retrieve the revision - - name: Mark directory as safe - shell: pwsh - run: | - Set-PSDebug -Trace 1 - & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'git config --global --add safe.directory "$OLDPWD"') - - name: Set ADD_REVISION=1 for non-release if: ${{ !startsWith(github.ref, 'refs/tags/') }} shell: pwsh @@ -85,20 +78,15 @@ jobs: shell: pwsh run: | Set-PSDebug -Trace 1 - & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -s -f Makefile.win -j`nproc` haxe 2>&1') - & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -s -f Makefile.win haxelib 2>&1') - & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -f Makefile.win echo_package_files package_bin package_installer_win package_choco 2>&1') - dir out - & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && cygcheck ./haxe.exe') - & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && cygcheck ./haxelib.exe') - & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && ls ./out') - - - name: Check artifact - shell: bash - run: | - ls out - # Output should contain binaries zip, installer zip and nupkg - [ $(ls -1 out | wc -l) -eq "3" ] + # stop after any command returns an error + $PSNativeCommandUseErrorActionPreference = $true + $ErrorActionPreference = 'Stop' + opam exec -- make -s -f Makefile.win -j"$env:NUMBER_OF_PROCESSORS" haxe + opam exec -- make -s -f Makefile.win haxelib + opam exec -- make -f Makefile.win echo_package_files package_bin package_installer_win package_choco + cygcheck ./haxe.exe + cygcheck ./haxelib.exe + ls ./out - name: Upload artifact uses: actions/upload-artifact@v4 diff --git a/extra/github-actions/build-windows.yml b/extra/github-actions/build-windows.yml index badd94ce76a..a9afb9c4636 100644 --- a/extra/github-actions/build-windows.yml +++ b/extra/github-actions/build-windows.yml @@ -1,10 +1,3 @@ -# required to be able to retrieve the revision -- name: Mark directory as safe - shell: pwsh - run: | - Set-PSDebug -Trace 1 - & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'git config --global --add safe.directory "$OLDPWD"') - - name: Set ADD_REVISION=1 for non-release if: ${{ !startsWith(github.ref, 'refs/tags/') }} shell: pwsh @@ -14,20 +7,15 @@ shell: pwsh run: | Set-PSDebug -Trace 1 - & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -s -f Makefile.win -j`nproc` haxe 2>&1') - & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -s -f Makefile.win haxelib 2>&1') - & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -f Makefile.win echo_package_files package_bin package_installer_win package_choco 2>&1') - dir out - & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && cygcheck ./haxe.exe') - & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && cygcheck ./haxelib.exe') - & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && ls ./out') - -- name: Check artifact - shell: bash - run: | - ls out - # Output should contain binaries zip, installer zip and nupkg - [ $(ls -1 out | wc -l) -eq "3" ] + # stop after any command returns an error + $PSNativeCommandUseErrorActionPreference = $true + $ErrorActionPreference = 'Stop' + opam exec -- make -s -f Makefile.win -j"$env:NUMBER_OF_PROCESSORS" haxe + opam exec -- make -s -f Makefile.win haxelib + opam exec -- make -f Makefile.win echo_package_files package_bin package_installer_win package_choco + cygcheck ./haxe.exe + cygcheck ./haxelib.exe + ls ./out - name: Upload artifact uses: actions/upload-artifact@v4