Skip to content

Commit

Permalink
start on 32 bit removal
Browse files Browse the repository at this point in the history
  • Loading branch information
Simn committed Feb 3, 2024
1 parent 2b0e8ce commit c193f80
Showing 1 changed file with 3 additions and 240 deletions.
243 changes: 3 additions & 240 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,140 +120,6 @@ jobs:
path: out


windows-build:
runs-on: windows-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
PLATFORM: windows
ARCH: 32
MINGW_ARCH: i686
CYG_ROOT: D:\cygwin
steps:
- uses: actions/checkout@main
with:
submodules: recursive

- name: Use GNU Tar from msys
run: |
echo "C:\msys64\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
rm C:\msys64\usr\bin\bash.exe
- name: choco install nsis
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
max_attempts: 10
command: choco install --no-progress nsis.portable --version 3.09 -y

- name: choco install things
shell: pwsh
run: choco install --no-progress curl wget 7zip.portable -y

- name: Prepend Chocolatey path
shell: pwsh
run: Write-Host "::add-path::C:\ProgramData\chocolatey\bin"

- name: Install Neko from S3
shell: pwsh
run: |
Invoke-WebRequest https://build.haxe.org/builds/neko/$env:PLATFORM/neko_latest.zip -OutFile $env:RUNNER_TEMP/neko_latest.zip
Expand-Archive $env:RUNNER_TEMP/neko_latest.zip -DestinationPath $env:RUNNER_TEMP
$NEKOPATH = Get-ChildItem $env:RUNNER_TEMP/neko-*-*
echo "$NEKOPATH" >> $env:GITHUB_PATH
echo "NEKOPATH=$NEKOPATH" >> $env:GITHUB_ENV
- name: Print Neko version
run: neko -version 2>&1

- name: Setup ocaml
id: ocaml
continue-on-error: true
uses: kLabz/setup-ocaml@win32
with:
ocaml-compiler: 4.08.1
opam-depext: false
opam-repositories: |
opam-repository-mingw: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
default: https://github.com/ocaml/opam-repository.git
opam-local-packages: |
haxe.opam
cache-prefix: w32-v1

# TODO make it work on first try
# (when cygwin cache doesn't exist, ocaml install fails with a curl error)
- name: Setup ocaml (second chance)
if: steps.ocaml.outcome == 'failure'
uses: kLabz/setup-ocaml@win32
with:
ocaml-compiler: 4.08.1
opam-depext: false
opam-repositories: |
opam-repository-mingw: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
default: https://github.com/ocaml/opam-repository.git
opam-local-packages: |
haxe.opam
cache-prefix: w32-v1

- name: Install dependencies
shell: pwsh
run: |
Set-PSDebug -Trace 1
curl.exe -fsSL -o "libmbedtls.tar.xz" --retry 3 https://github.com/Simn/mingw64-mbedtls/releases/download/2.16.3/mingw64-$($env:MINGW_ARCH)-mbedtls-2.16.3-1.tar.xz
& "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'curl -L https://cpanmin.us | perl - App::cpanminus')
& "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cpanm IPC::System::Simple module')
& "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cpanm String::ShellQuote')
& "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'echo "$OLDPWD"')
& "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && tar -C / -xvf libmbedtls.tar.xz')
- name: Install OCaml libraries
shell: pwsh
run: |
Set-PSDebug -Trace 1
opam install haxe --deps-only
opam list
- name: Expose mingw dll files
shell: pwsh
run: Write-Host "::add-path::${env:CYG_ROOT}/usr/$($env:MINGW_ARCH)-w64-mingw32/sys-root/mingw/bin"

# 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
run: echo "ADD_REVISION=1" >> $Env:GITHUB_ENV

- name: Build Haxe
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" ]
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: win${{env.ARCH}}Binaries
path: out


linux-build:
runs-on: ubuntu-20.04
env:
Expand Down Expand Up @@ -773,103 +639,6 @@ jobs:
working-directory: ${{github.workspace}}/tests


windows-test:
needs: windows-build
runs-on: windows-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
PLATFORM: windows
TEST: ${{matrix.target}}
HXCPP_COMPILE_CACHE: ~/hxcache
ARCH: 32
strategy:
fail-fast: false
matrix:
# TODO jvm: https://github.com/HaxeFoundation/haxe/issues/8601
# TODO enable lua after https://github.com/HaxeFoundation/haxe/issues/10919
target: [macro, js, hl, cpp, java, cs, php, python, flash, neko]
steps:
- uses: actions/checkout@main
with:
submodules: recursive
- uses: actions/download-artifact@v3
with:
name: win${{env.ARCH}}Binaries
path: win${{env.ARCH}}Binaries

- name: Install Neko from S3
shell: pwsh
run: |
Invoke-WebRequest https://build.haxe.org/builds/neko/$env:PLATFORM/neko_latest.zip -OutFile $env:RUNNER_TEMP/neko_latest.zip
Expand-Archive $env:RUNNER_TEMP/neko_latest.zip -DestinationPath $env:RUNNER_TEMP
$NEKOPATH = Get-ChildItem $env:RUNNER_TEMP/neko-*-*
echo "$NEKOPATH" >> $env:GITHUB_PATH
echo "NEKOPATH=$NEKOPATH" >> $env:GITHUB_ENV
- name: Print Neko version
run: neko -version 2>&1

- uses: actions/setup-node@v3
with:
node-version: 18.17.1

# - name: Quick test
# shell: pwsh
# run: |
# $DOWNLOADDIR="./win$($env:ARCH)Binaries"
# new-item -Name $DOWNLOADDIR -ItemType directory
# Invoke-WebRequest https://build.haxe.org/builds/haxe/$env:PLATFORM/haxe_latest.zip -OutFile $DOWNLOADDIR/haxe_bin.zip

- name: Setup Haxe
shell: pwsh
run: |
$DOWNLOADDIR="./win$($env:ARCH)Binaries"
Expand-Archive $DOWNLOADDIR/*_bin.zip -DestinationPath $DOWNLOADDIR
Set-PSDebug -Trace 1
$HAXEPATH = Get-ChildItem $DOWNLOADDIR/haxe_*_* -Directory
Write-Host "::add-path::$HAXEPATH"
Write-Host "::set-env name=HAXELIB_ROOT::$HAXEPATH\lib"
- name: Print Haxe version
shell: pwsh
run: haxe -version

- name: "Make Python 3 be available as python3 in the cmdline"
shell: pwsh
run: |
Set-PSDebug -Trace 1
$pypath = python -c "import sys; print(sys.executable)"
$py3path = $pypath.replace("python.exe","python3.exe")
cmd /c mklink $py3path $pypath
python3 -V
- name: Install hererocks
if: matrix.target == 'lua'
shell: cmd
run: |
pip install hererocks
hererocks lua53 -l5.3 -rlatest
call lua53/bin/activate
- name: Install wget
if: matrix.target == 'flash'
shell: cmd
run: |
choco install wget
wget --version
- name: Setup haxelib
shell: pwsh
run: |
mkdir "$env:HAXELIB_ROOT"
haxelib setup "$env:HAXELIB_ROOT"
- name: Test
shell: pwsh
run: haxe RunCi.hxml
working-directory: ${{github.workspace}}/tests


mac-test:
needs: mac-build
runs-on: macos-latest
Expand Down Expand Up @@ -947,7 +716,7 @@ jobs:

deploy:
if: success() && github.repository_owner == 'HaxeFoundation' && github.event_name != 'pull_request'
needs: [linux-test, linux-arm64, mac-test, windows-test, windows64-test]
needs: [linux-test, linux-arm64, mac-test, windows64-test]
runs-on: ubuntu-20.04
steps:
# this is only needed for to get `COMMIT_DATE`...
Expand Down Expand Up @@ -990,9 +759,6 @@ jobs:
aws s3 cp win64Binaries/*_bin.zip ${HXBUILDS_S3ADDR}/haxe/windows64/${FILE_NAME}.zip
aws s3 cp win64Binaries/*_installer.zip ${HXBUILDS_S3ADDR}/haxe/windows64-installer/${FILE_NAME}.zip
aws s3 cp win64Binaries/*.nupkg ${HXBUILDS_S3ADDR}/haxe/windows64-choco/
aws s3 cp win32Binaries/*_bin.zip ${HXBUILDS_S3ADDR}/haxe/windows/${FILE_NAME}.zip
aws s3 cp win32Binaries/*_installer.zip ${HXBUILDS_S3ADDR}/haxe/windows-installer/${FILE_NAME}.zip
aws s3 cp win32Binaries/*.nupkg ${HXBUILDS_S3ADDR}/haxe/windows-choco/
- name: Update "latest"
if: github.ref == 'refs/heads/development'
Expand All @@ -1010,20 +776,17 @@ jobs:
aws s3 cp macBinaries/*_installer.tar.gz ${HXBUILDS_S3ADDR}/haxe/mac-installer/haxe_latest.tar.gz
aws s3 cp win64Binaries/*_bin.zip ${HXBUILDS_S3ADDR}/haxe/windows64/haxe_latest.zip
aws s3 cp win64Binaries/*_installer.zip ${HXBUILDS_S3ADDR}/haxe/windows64-installer/haxe_latest.zip
aws s3 cp win32Binaries/*_bin.zip ${HXBUILDS_S3ADDR}/haxe/windows/haxe_latest.zip
aws s3 cp win32Binaries/*_installer.zip ${HXBUILDS_S3ADDR}/haxe/windows-installer/haxe_latest.zip
# Chocolatey packages have to be named with version number,
# so let's use web redirection to keep the original file name.
[[ "$HXBUILDS_S3ADDR" =~ s3://([^/]+)(.*) ]] && HXBUILDS_S3BUCKET="${BASH_REMATCH[1]}" && HXBUILDS_S3PATH="${BASH_REMATCH[2]}"
[[ `echo win64Binaries/*.nupkg` =~ win64Binaries/(.+) ]] && FILE_NAME="${BASH_REMATCH[1]}"
aws s3 cp ${HXBUILDS_S3ADDR}/haxe/windows64-choco/${FILE_NAME} ${HXBUILDS_S3ADDR}/haxe/windows64-choco/haxe_latest.nupkg --acl public-read --website-redirect "${HXBUILDS_S3PATH}/haxe/windows64-choco/${FILE_NAME}"
[[ `echo win32Binaries/*.nupkg` =~ win32Binaries/(.+) ]] && FILE_NAME="${BASH_REMATCH[1]}"
aws s3 cp ${HXBUILDS_S3ADDR}/haxe/windows-choco/${FILE_NAME} ${HXBUILDS_S3ADDR}/haxe/windows-choco/haxe_latest.nupkg --acl public-read --website-redirect "${HXBUILDS_S3PATH}/haxe/windows-choco/${FILE_NAME}"
deploy_apidoc:
if: success() && github.repository_owner == 'HaxeFoundation' && github.event_name != 'pull_request'
needs: [linux-test, linux-arm64, mac-test, windows-test, windows64-test]
needs: [linux-test, linux-arm64, mac-test, windows64-test]
runs-on: ubuntu-20.04
steps:
- name: Install dependencies
Expand Down

0 comments on commit c193f80

Please sign in to comment.