diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f4292f34cd4..7b03415367c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -98,160 +98,48 @@ jobs: shell: pwsh run: | Set-PSDebug -Trace 1 + git config --global --add safe.directory /cygdrive/d/a/haxe/haxe & "$($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@v1.0.0 - with: - name: win${{env.ARCH}}Binaries - 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@v1 - with: - timeout_minutes: 10 - max_attempts: 10 - command: choco install --no-progress nsis.portable --version 3.02 -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 + - name: Get KhaTools_windows_x64 + run: git clone https://github.com/Kode/KhaTools_windows_x64.git + - name: Copy binary + run: copy haxe.exe KhaTools_windows_x64\haxe.exe + - name: Copy new std 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@v1.0.0 - with: - name: win${{env.ARCH}}Binaries - path: out + run: robocopy std KhaTools_windows_x64\std /mir + - name: Set name + run: git config --global user.name "Robbot" + - name: Set email + run: git config --global user.email "robbot2019@robdangero.us" + - name: Add everything + run: git -C KhaTools_windows_x64 add . + - name: Commit binary + id: commit + continue-on-error: true + run: git -C KhaTools_windows_x64 commit -a -m "Update Haxe binary to ${env:GITHUB_SHA}." + - name: Tag binary + id: tag + continue-on-error: true + if: steps.commit.outcome == 'success' + run: git -C KhaTools_windows_x64 tag haxe_${env:GITHUB_SHA} + - name: Push binary + id: push1 + if: steps.commit.outcome == 'success' && steps.tag.outcome == 'success' + continue-on-error: true + run: git -C KhaTools_windows_x64 push https://Kode-Robbot:${env:ROBBOT_PASS}@github.com/Kode/KhaTools_windows_x64.git main --tags + env: + ROBBOT_PASS: ${{ secrets.ROBBOT_PASS }} + - name: Pull + if: steps.commit.outcome == 'success' && steps.tag.outcome == 'success' && steps.push1.outcome != 'success' + run: git -C KhaTools_windows_x64 pull --no-rebase + - name: Push binary again + if: steps.commit.outcome == 'success' && steps.tag.outcome == 'success' && steps.push1.outcome != 'success' + continue-on-error: true + run: git -C KhaTools_windows_x64 push https://Kode-Robbot:${env:ROBBOT_PASS}@github.com/Kode/KhaTools_windows_x64.git main --tags + env: + ROBBOT_PASS: ${{ secrets.ROBBOT_PASS }} linux-build: @@ -317,200 +205,47 @@ jobs: set -ex eval $(opam env) opam config exec -- make -s -j`nproc` STATICLINK=1 haxe - opam config exec -- make -s haxelib make -s package_unix ls -l out ldd -v ./haxe - ldd -v ./haxelib - - # https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions - - name: Extract branch name - id: extract_branch - shell: bash - run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" - - - name: Build xmldoc - run: | - set -ex - make -s xmldoc - cat >extra/doc/info.json <> $GITHUB_ENV - - - name: Print Neko version - run: neko -version 2>&1 - - - - name: Setup Haxe - run: | - sudo apt install -qqy libmbedtls-dev - - set -ex - tar -xf linuxBinaries/*_bin.tar.gz -C linuxBinaries --strip-components=1 - sudo mkdir -p /usr/local/bin/ - sudo mkdir -p /usr/local/share/haxe/ - sudo ln -s `pwd`/linuxBinaries/haxe /usr/local/bin/haxe - sudo ln -s `pwd`/linuxBinaries/haxelib /usr/local/bin/haxelib - sudo ln -s `pwd`/linuxBinaries/std /usr/local/share/haxe/std - - - name: Print Haxe version - run: haxe -version - - name: Setup haxelib - run: | - set -ex - mkdir ~/haxelib - haxelib setup ~/haxelib - - - name: Install apt packages - if: matrix.APT_PACKAGES - run: | - set -ex - sudo apt update -qqy - sudo apt install -qqy ${{matrix.APT_PACKAGES}} - - - name: Flash setup - if: matrix.target == 'flash' - run: export DISPLAY=:99.0 - - - name: Test - run: haxe RunCi.hxml - working-directory: ${{github.workspace}}/tests - - test-docgen: - needs: linux-build - runs-on: ubuntu-20.04 - env: - PLATFORM: linux64 - HXCPP_COMPILE_CACHE: ~/hxcache - steps: - - uses: actions/checkout@main - with: - submodules: recursive - - - uses: actions/download-artifact@v1 - with: - name: linuxBinaries - - - name: Download xmldoc artifact - uses: actions/download-artifact@v2 - with: - name: xmldoc - path: xmldoc - - - name: Install Neko from S3 - run: | - set -ex - - curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $RUNNER_TEMP/neko_latest.tar.gz - tar -xf $RUNNER_TEMP/neko_latest.tar.gz -C $RUNNER_TEMP - NEKOPATH=`echo $RUNNER_TEMP/neko-*-*` - sudo mkdir -p /usr/local/bin - sudo mkdir -p /usr/local/lib/neko - sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/ - sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/ - sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/ - echo "NEKOPATH=$NEKOPATH" >> $GITHUB_ENV - - - name: Print Neko version - run: neko -version 2>&1 - - - - name: Setup Haxe - run: | - sudo apt install -qqy libmbedtls-dev - - set -ex - tar -xf linuxBinaries/*_bin.tar.gz -C linuxBinaries --strip-components=1 - sudo mkdir -p /usr/local/bin/ - sudo mkdir -p /usr/local/share/haxe/ - sudo ln -s `pwd`/linuxBinaries/haxe /usr/local/bin/haxe - sudo ln -s `pwd`/linuxBinaries/haxelib /usr/local/bin/haxelib - sudo ln -s `pwd`/linuxBinaries/std /usr/local/share/haxe/std - - - name: Print Haxe version - run: haxe -version - - - name: Setup haxelib - run: | - set -ex - mkdir ~/haxelib - haxelib setup ~/haxelib - - - name: Test documentation generation - run: | - set -ex - haxelib git dox https://github.com/HaxeFoundation/dox.git - haxelib git hxtemplo https://github.com/Simn/hxtemplo.git - haxelib git hxargs https://github.com/Simn/hxargs.git - haxelib git markdown https://github.com/dpeek/haxe-markdown.git - haxelib git hxcpp https://github.com/HaxeFoundation/hxcpp.git - cd $(haxelib libpath hxcpp)/tools/hxcpp - haxe compile.hxml - cd - - haxe dox.hxml - mkdir resources - cp ../../src-json/* resources - cpp/Dox -i ../../xmldoc -ex microsoft -ex javax -ex cs.internal -theme $(haxelib libpath dox)/themes/default - working-directory: ${{github.workspace}}/tests/docgen + - name: Get KhaTools_linux_x64 + run: git clone https://github.com/Kode/KhaTools_linux_x64.git + - name: Copy binary + run: cp ./haxe KhaTools_linux_x64/haxe + - name: Remove old std + run: rm -r KhaTools_linux_x64/std + - name: Copy new std + run: cp -R std KhaTools_linux_x64/std + - name: Set name + run: git config --global user.name "Robbot" + - name: Set email + run: git config --global user.email "robbot2019@robdangero.us" + - name: Add everything + run: git -C KhaTools_linux_x64 add . + - name: Commit binary + id: commit + continue-on-error: true + run: git -C KhaTools_linux_x64 commit -a -m "Update Haxe binary to $GITHUB_SHA." + - name: Tag binary + if: steps.commit.outcome == 'success' + run: git -C KhaTools_linux_x64 tag haxe_$GITHUB_SHA + - name: Push binary + id: push1 + if: steps.commit.outcome == 'success' + continue-on-error: true + run: git -C KhaTools_linux_x64 push https://Kode-Robbot:$ROBBOT_PASS@github.com/Kode/KhaTools_linux_x64.git main --tags + env: + ROBBOT_PASS: ${{ secrets.ROBBOT_PASS }} + - name: Pull + if: steps.commit.outcome == 'success' && steps.push1.outcome != 'success' + run: git -C KhaTools_linux_x64 pull --no-rebase + - name: Push binary again + if: steps.commit.outcome == 'success' && steps.push1.outcome != 'success' + continue-on-error: true + run: git -C KhaTools_linux_x64 push https://Kode-Robbot:$ROBBOT_PASS@github.com/Kode/KhaTools_linux_x64.git main --tags + env: + ROBBOT_PASS: ${{ secrets.ROBBOT_PASS }} linux-arm64: runs-on: ubuntu-20.04 @@ -562,11 +297,43 @@ jobs: EARTHLY_PUSH: "${{ github.event_name == 'push' }}" EARTHLY_REMOTE_CACHE: "ghcr.io/${{env.CONTAINER_REG}}_cache:build-${{env.CONTAINER_TAG}}-arm64" - - name: Upload artifact - uses: actions/upload-artifact@v1.0.0 - with: - name: linuxArm64Binaries - path: out/linux/arm64 + - name: Get KhaTools_linux_arm64 + run: git clone https://github.com/Kode/KhaTools_linux_arm64.git + - name: Copy binary + run: cp ./out/linux/arm64/haxe KhaTools_linux_arm64/haxe + - name: Remove old std + run: rm -r KhaTools_linux_arm64/std + - name: Copy new std + run: cp -R std KhaTools_linux_arm64/std + - name: Set name + run: git config --global user.name "Robbot" + - name: Set email + run: git config --global user.email "robbot2019@robdangero.us" + - name: Add everything + run: git -C KhaTools_linux_arm64 add . + - name: Commit binary + id: commit + continue-on-error: true + run: git -C KhaTools_linux_arm64 commit -a -m "Update Haxe binary to $GITHUB_SHA." + - name: Tag binary + if: steps.commit.outcome == 'success' + run: git -C KhaTools_linux_arm64 tag haxe_$GITHUB_SHA + - name: Push binary + id: push1 + if: steps.commit.outcome == 'success' + continue-on-error: true + run: git -C KhaTools_linux_arm64 push https://Kode-Robbot:$ROBBOT_PASS@github.com/Kode/KhaTools_linux_arm64.git main --tags + env: + ROBBOT_PASS: ${{ secrets.ROBBOT_PASS }} + - name: Pull + if: steps.commit.outcome == 'success' && steps.push1.outcome != 'success' + run: git -C KhaTools_linux_arm64 pull --no-rebase + - name: Push binary again + if: steps.commit.outcome == 'success' && steps.push1.outcome != 'success' + continue-on-error: true + run: git -C KhaTools_linux_arm64 push https://Kode-Robbot:$ROBBOT_PASS@github.com/Kode/KhaTools_linux_arm64.git main --tags + env: + ROBBOT_PASS: ${{ secrets.ROBBOT_PASS }} mac-build: runs-on: macos-latest @@ -661,391 +428,45 @@ jobs: set -ex eval $(opam env) opam config exec -- make -s -j`sysctl -n hw.ncpu` STATICLINK=1 "LIB_PARAMS=/usr/local/lib/libz.a /usr/local/lib/libpcre2-8.a /usr/local/lib/libmbedtls.a /usr/local/lib/libmbedcrypto.a /usr/local/lib/libmbedx509.a -cclib '-framework Security -framework CoreFoundation'" haxe - opam config exec -- make -s haxelib - make -s package_unix package_installer_mac - ls -l out otool -L ./haxe - otool -L ./haxelib - - - name: Upload artifact - uses: actions/upload-artifact@v1.0.0 - with: - name: macBinaries - path: out - - - windows64-test: - needs: windows64-build - runs-on: windows-latest - env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: true - PLATFORM: windows64 - TEST: ${{matrix.target}} - HXCPP_COMPILE_CACHE: ~/hxcache - ARCH: 64 - strategy: - fail-fast: false - matrix: - # TODO enable lua after https://github.com/HaxeFoundation/haxe/issues/10919 - target: [macro, js, hl, cpp, 'java,jvm', cs, php, python, flash, neko] - steps: - - uses: actions/checkout@main - with: - submodules: recursive - - uses: actions/download-artifact@v1 - with: - name: 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 - - # - 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 - - - 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@v1 - with: - name: 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 - - # - 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 - env: - PLATFORM: mac - TEST: ${{matrix.target}} - HXCPP_COMPILE_CACHE: ~/hxcache - HAXE_STD_PATH: /usr/local/share/haxe/std - strategy: - fail-fast: false - matrix: - target: [macro, js, hl, cpp, 'java,jvm', cs, php, python, flash, neko] - include: - - target: hl - BREW_PACKAGES: ninja - steps: - - uses: actions/checkout@main - with: - submodules: recursive - - uses: actions/download-artifact@v1 - with: - name: macBinaries - - - name: Install Neko from S3 - run: | - set -ex - - curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $RUNNER_TEMP/neko_latest.tar.gz - tar -xf $RUNNER_TEMP/neko_latest.tar.gz -C $RUNNER_TEMP - NEKOPATH=`echo $RUNNER_TEMP/neko-*-*` - sudo mkdir -p /usr/local/bin - sudo mkdir -p /usr/local/lib/neko - sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/ - sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/ - sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/ - echo "NEKOPATH=$NEKOPATH" >> $GITHUB_ENV - - - name: Print Neko version - run: neko -version 2>&1 - - - name: Setup Haxe - run: | - # mkdir ./macBinaries - # curl -sSL https://build.haxe.org/builds/haxe/mac/haxe_latest.tar.gz -o ./macBinaries/haxe_bin.tar.gz - - set -ex - tar -xf macBinaries/*_bin.tar.gz -C macBinaries --strip-components=1 - sudo mkdir -p /usr/local/bin/ - sudo mkdir -p /usr/local/share/haxe/ - sudo ln -s `pwd`/macBinaries/haxe /usr/local/bin/haxe - sudo ln -s `pwd`/macBinaries/haxelib /usr/local/bin/haxelib - sudo ln -s `pwd`/macBinaries/std /usr/local/share/haxe/std - - - name: Print Haxe version - run: haxe -version - - - name: Setup haxelib - run: | - set -ex - mkdir ~/haxelib - haxelib setup ~/haxelib - - - name: Install homebrew packages - if: matrix.BREW_PACKAGES - run: brew install ${{matrix.BREW_PACKAGES}} - - - name: Test - run: | - # disable invalid Unicode filenames on APFS - echo "" > sys/compile-fs.hxml - haxe RunCi.hxml - working-directory: ${{github.workspace}}/tests - - - deploy: - if: success() && github.repository_owner == 'HaxeFoundation' && github.event_name != 'pull_request' - needs: [linux-test, linux-arm64, mac-test, windows-test, windows64-test] - runs-on: ubuntu-20.04 - steps: - # this is only needed for to get `COMMIT_DATE`... - # maybe https://github.community/t/expose-commit-timestamp-in-the-github-context-data/16460/3 - # would be faster - - name: Checkout the repository - uses: actions/checkout@main - - - name: Download build artifacts - uses: actions/download-artifact@v2 - - - name: Install awscli - run: | - set -ex - sudo apt-get update -qqy - sudo apt-get install -qqy awscli - - # https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions - - name: Extract branch name - id: extract_branch - shell: bash - run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" - - - name: Upload binaries - shell: bash + - name: Get KhaTools_macos + run: git clone https://github.com/Kode/KhaTools_macos.git + - name: Copy binary + run: cp ./haxe KhaTools_macos/haxe + - name: Remove old std + run: rm -r KhaTools_macos/std + - name: Copy new std + run: cp -R std KhaTools_macos/std + - name: Set name + run: git config --global user.name "Robbot" + - name: Set email + run: git config --global user.email "robbot2019@robdangero.us" + - name: Add everything + run: git -C KhaTools_macos add . + - name: Commit binary + id: commit + continue-on-error: true + run: git -C KhaTools_macos commit -a -m "Update Haxe binary to $GITHUB_SHA." + - name: Tag binary + id: tag + continue-on-error: true + if: steps.commit.outcome == 'success' + run: git -C KhaTools_macos tag haxe_$GITHUB_SHA + - name: Push binary + id: push1 + if: steps.commit.outcome == 'success' && steps.tag.outcome == 'success' + continue-on-error: true + run: git -C KhaTools_macos push https://Kode-Robbot:$ROBBOT_PASS@github.com/Kode/KhaTools_macos.git main --tags env: - AWS_ACCESS_KEY_ID: ${{ secrets.HXBUILDS_AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.HXBUILDS_AWS_SECRET_ACCESS_KEY }} - HXBUILDS_S3ADDR: ${{ secrets.HXBUILDS_S3ADDR }} - AWS_EC2_METADATA_DISABLED: true - run: | - set -ex - COMMIT_HASH_SHORT=${GITHUB_SHA:0:7} - COMMIT_DATE=`TZ=UTC git show --quiet --date='format-local:%Y-%m-%d' --format="%cd"` - FILE_NAME=haxe_${COMMIT_DATE}_${{ steps.extract_branch.outputs.branch }}_${COMMIT_HASH_SHORT} - aws s3 cp linuxBinaries/*_bin.tar.gz ${HXBUILDS_S3ADDR}/haxe/linux64/${FILE_NAME}.tar.gz - aws s3 cp linuxArm64Binaries/*_bin.tar.gz ${HXBUILDS_S3ADDR}/haxe/linux-arm64/${FILE_NAME}.tar.gz - aws s3 cp macBinaries/*_bin.tar.gz ${HXBUILDS_S3ADDR}/haxe/mac/${FILE_NAME}.tar.gz - aws s3 cp macBinaries/*_installer.tar.gz ${HXBUILDS_S3ADDR}/haxe/mac-installer/${FILE_NAME}.tar.gz - 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' - shell: bash + ROBBOT_PASS: ${{ secrets.ROBBOT_PASS }} + - name: Pull + if: steps.commit.outcome == 'success' && steps.tag.outcome == 'success' && steps.push1.outcome != 'success' + run: git -C KhaTools_macos pull --no-rebase + - name: Push binary again + if: steps.commit.outcome == 'success' && steps.tag.outcome == 'success' && steps.push1.outcome != 'success' + continue-on-error: true + run: git -C KhaTools_macos push https://Kode-Robbot:$ROBBOT_PASS@github.com/Kode/KhaTools_macos.git main --tags env: - AWS_ACCESS_KEY_ID: ${{ secrets.HXBUILDS_AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.HXBUILDS_AWS_SECRET_ACCESS_KEY }} - HXBUILDS_S3ADDR: ${{ secrets.HXBUILDS_S3ADDR }} - AWS_EC2_METADATA_DISABLED: true - run: | - set -ex - aws s3 cp linuxBinaries/*_bin.tar.gz ${HXBUILDS_S3ADDR}/haxe/linux64/haxe_latest.tar.gz - aws s3 cp linuxArm64Binaries/*_bin.tar.gz ${HXBUILDS_S3ADDR}/haxe/linux-arm64/haxe_latest.tar.gz - aws s3 cp macBinaries/*_bin.tar.gz ${HXBUILDS_S3ADDR}/haxe/mac/haxe_latest.tar.gz - 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 + ROBBOT_PASS: ${{ secrets.ROBBOT_PASS }} - # 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] - runs-on: ubuntu-20.04 - steps: - - name: Install dependencies - run: | - set -ex - sudo apt-get install -qqy libc6 - - - name: Download Haxe - uses: actions/download-artifact@v2 - with: - name: linuxBinaries - path: linuxBinaries - - - name: Setup Haxe - run: | - set -ex - tar -xf linuxBinaries/*_bin.tar.gz -C linuxBinaries --strip-components=1 - sudo mkdir -p /usr/local/bin/ - sudo mkdir -p /usr/local/share/haxe/ - sudo ln -s `pwd`/linuxBinaries/haxe /usr/local/bin/haxe - sudo ln -s `pwd`/linuxBinaries/haxelib /usr/local/bin/haxelib - sudo ln -s `pwd`/linuxBinaries/std /usr/local/share/haxe/std - - - name: Download xmldoc artifact - uses: actions/download-artifact@v2 - with: - name: xmldoc - path: xmldoc - - - name: Deploy to api.haxe.org - env: - GHP_EMAIL: haxe-ci@onthewings.net - GHP_USERNAME: Haxe CI Bot - GHP_REMOTE: ${{ secrets.GHP_REMOTE }} - run: | - set -ex - LOCAL="`pwd`/extra/api.haxe.org" - git clone "${GHP_REMOTE}" "${LOCAL}" - haxe --cwd "${LOCAL}" --run ImportXml "`pwd`/xmldoc"