main.yml 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717
  1. # DO NOT EDIT. Generated from /extra/github-actions
  2. # TODO: support skip ci (https://github.community/t/github-actions-does-not-respect-skip-ci/17325/8)
  3. name: CI
  4. on: [push, pull_request]
  5. jobs:
  6. cancel:
  7. name: "Cancel previous runs"
  8. runs-on: ubuntu-latest
  9. timeout-minutes: 3
  10. steps:
  11. - uses: styfle/[email protected]
  12. with:
  13. workflow_id: 1447568
  14. access_token: ${{ github.token }}
  15. windows64-build:
  16. runs-on: windows-latest
  17. env:
  18. ACTIONS_ALLOW_UNSECURE_COMMANDS: true
  19. PLATFORM: windows64
  20. OPAMYES: 1
  21. CYG_MIRROR: http://mirrors.kernel.org/sourceware/cygwin/
  22. ARCH: 64
  23. MINGW_ARCH: x86_64
  24. CYGWIN_SETUP: https://cygwin.com/setup-x86_64.exe
  25. CYG_ROOT: C:/cygwin64
  26. steps:
  27. - uses: actions/checkout@main
  28. with:
  29. submodules: recursive
  30. - name: Install Neko using snapshot from S3 (Windows)
  31. if: startsWith(env.PLATFORM, 'windows')
  32. shell: pwsh
  33. run: |
  34. $DOWNLOADDIR="./temp"
  35. new-item -Name $DOWNLOADDIR -ItemType directory
  36. Invoke-WebRequest https://build.haxe.org/builds/neko/$env:PLATFORM/neko_latest.zip -OutFile $DOWNLOADDIR/neko_latest.zip
  37. Expand-Archive $DOWNLOADDIR/neko_latest.zip -DestinationPath $DOWNLOADDIR
  38. $NEKOPATH = Get-ChildItem $DOWNLOADDIR/neko-*-*
  39. Write-Host "::add-path::$NEKOPATH"
  40. Write-Host "::set-env name=NEKOPATH::$NEKOPATH"
  41. - name: Print Neko version
  42. run: neko -version 2>&1
  43. - name: choco install nsis
  44. uses: nick-invision/retry@v1
  45. with:
  46. timeout_minutes: 10
  47. max_attempts: 10
  48. command: choco install --no-progress nsis.portable --version 3.02 -y
  49. - name: choco install things
  50. shell: pwsh
  51. run: choco install --no-progress curl wget 7zip.portable -y
  52. - name: Prepend Chocolatey path
  53. shell: pwsh
  54. run: Write-Host "::add-path::C:\ProgramData\chocolatey\bin"
  55. - name: Install OCaml and OCaml libraries
  56. shell: pwsh
  57. run: |
  58. Set-PSDebug -Trace 1
  59. curl.exe -fsSL -o cygwin-setup.exe --retry 3 $($env:CYGWIN_SETUP)
  60. Start-Process -FilePath "cygwin-setup.exe" -ArgumentList "-B -q -R $($env:CYG_ROOT) -l C:/tmp -s $($env:CYG_MIRROR) -P default -P make -P git -P zlib-devel -P rsync -P patch -P diffutils -P curl -P unzip -P tar -P m4 -P perl -P libpcre-devel -P mbedtls-devel -P mingw64-$($env:MINGW_ARCH)-zlib -P mingw64-$($env:MINGW_ARCH)-gcc-core -P mingw64-$($env:MINGW_ARCH)-pcre" -Wait
  61. curl.exe -fsSL -o "opam.tar.xz" --retry 3 https://github.com/fdopen/opam-repository-mingw/releases/download/0.0.0.2/opam$($env:ARCH).tar.xz
  62. 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
  63. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'echo "$OLDPWD"')
  64. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && tar -C / -xvf libmbedtls.tar.xz')
  65. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && tar -xf opam.tar.xz')
  66. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && bash opam${ARCH}/install.sh')
  67. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam init mingw "https://github.com/fdopen/opam-repository-mingw.git#opam2" --comp 4.07.0+mingw${ARCH}c --switch 4.07.0+mingw${ARCH}c --auto-setup --yes 2>&1')
  68. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam update --yes 2>&1')
  69. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam pin add haxe . --kind=path --no-action --yes 2>&1')
  70. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam install haxe --deps-only --yes 2>&1')
  71. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam pin add luv https://github.com/aantron/luv.git#somaxconn --yes 2>&1')
  72. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam list')
  73. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'ocamlopt -v')
  74. - name: Expose mingw dll files
  75. shell: pwsh
  76. run: Write-Host "::add-path::${env:CYG_ROOT}/usr/$($env:MINGW_ARCH)-w64-mingw32/sys-root/mingw/bin"
  77. - name: Build Haxe
  78. shell: pwsh
  79. run: |
  80. Set-PSDebug -Trace 1
  81. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -s -f Makefile.win -j`nproc` haxe 2>&1')
  82. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -s -f Makefile.win haxelib 2>&1')
  83. & "$($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')
  84. dir out
  85. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && cygcheck ./haxe.exe')
  86. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && cygcheck ./haxelib.exe')
  87. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && ls ./out')
  88. - name: Upload artifact
  89. uses: actions/[email protected]
  90. with:
  91. name: win${{env.ARCH}}Binaries
  92. path: out
  93. windows-build:
  94. runs-on: windows-latest
  95. env:
  96. ACTIONS_ALLOW_UNSECURE_COMMANDS: true
  97. PLATFORM: windows
  98. OPAMYES: 1
  99. CYG_MIRROR: http://mirrors.kernel.org/sourceware/cygwin/
  100. ARCH: 32
  101. MINGW_ARCH: i686
  102. CYGWIN_SETUP: https://cygwin.com/setup-x86.exe
  103. CYG_ROOT: C:/cygwin
  104. steps:
  105. - uses: actions/checkout@main
  106. with:
  107. submodules: recursive
  108. - name: Install Neko using snapshot from S3 (Windows)
  109. if: startsWith(env.PLATFORM, 'windows')
  110. shell: pwsh
  111. run: |
  112. $DOWNLOADDIR="./temp"
  113. new-item -Name $DOWNLOADDIR -ItemType directory
  114. Invoke-WebRequest https://build.haxe.org/builds/neko/$env:PLATFORM/neko_latest.zip -OutFile $DOWNLOADDIR/neko_latest.zip
  115. Expand-Archive $DOWNLOADDIR/neko_latest.zip -DestinationPath $DOWNLOADDIR
  116. $NEKOPATH = Get-ChildItem $DOWNLOADDIR/neko-*-*
  117. Write-Host "::add-path::$NEKOPATH"
  118. Write-Host "::set-env name=NEKOPATH::$NEKOPATH"
  119. - name: Print Neko version
  120. run: neko -version 2>&1
  121. - name: choco install nsis
  122. uses: nick-invision/retry@v1
  123. with:
  124. timeout_minutes: 10
  125. max_attempts: 10
  126. command: choco install --no-progress nsis.portable --version 3.02 -y
  127. - name: choco install things
  128. shell: pwsh
  129. run: choco install --no-progress curl wget 7zip.portable -y
  130. - name: Prepend Chocolatey path
  131. shell: pwsh
  132. run: Write-Host "::add-path::C:\ProgramData\chocolatey\bin"
  133. - name: Install OCaml and OCaml libraries
  134. shell: pwsh
  135. run: |
  136. Set-PSDebug -Trace 1
  137. curl.exe -fsSL -o cygwin-setup.exe --retry 3 $($env:CYGWIN_SETUP)
  138. Start-Process -FilePath "cygwin-setup.exe" -ArgumentList "-B -q -R $($env:CYG_ROOT) -l C:/tmp -s $($env:CYG_MIRROR) -P default -P make -P git -P zlib-devel -P rsync -P patch -P diffutils -P curl -P unzip -P tar -P m4 -P perl -P libpcre-devel -P mbedtls-devel -P mingw64-$($env:MINGW_ARCH)-zlib -P mingw64-$($env:MINGW_ARCH)-gcc-core -P mingw64-$($env:MINGW_ARCH)-pcre" -Wait
  139. curl.exe -fsSL -o "opam.tar.xz" --retry 3 https://github.com/fdopen/opam-repository-mingw/releases/download/0.0.0.2/opam$($env:ARCH).tar.xz
  140. 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
  141. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'echo "$OLDPWD"')
  142. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && tar -C / -xvf libmbedtls.tar.xz')
  143. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && tar -xf opam.tar.xz')
  144. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && bash opam${ARCH}/install.sh')
  145. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam init mingw "https://github.com/fdopen/opam-repository-mingw.git#opam2" --comp 4.07.0+mingw${ARCH}c --switch 4.07.0+mingw${ARCH}c --auto-setup --yes 2>&1')
  146. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam update --yes 2>&1')
  147. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam pin add haxe . --kind=path --no-action --yes 2>&1')
  148. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam install haxe --deps-only --yes 2>&1')
  149. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam pin add luv https://github.com/aantron/luv.git#somaxconn --yes 2>&1')
  150. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam list')
  151. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'ocamlopt -v')
  152. - name: Expose mingw dll files
  153. shell: pwsh
  154. run: Write-Host "::add-path::${env:CYG_ROOT}/usr/$($env:MINGW_ARCH)-w64-mingw32/sys-root/mingw/bin"
  155. - name: Build Haxe
  156. shell: pwsh
  157. run: |
  158. Set-PSDebug -Trace 1
  159. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -s -f Makefile.win -j`nproc` haxe 2>&1')
  160. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -s -f Makefile.win haxelib 2>&1')
  161. & "$($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')
  162. dir out
  163. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && cygcheck ./haxe.exe')
  164. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && cygcheck ./haxelib.exe')
  165. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && ls ./out')
  166. - name: Upload artifact
  167. uses: actions/[email protected]
  168. with:
  169. name: win${{env.ARCH}}Binaries
  170. path: out
  171. linux-build:
  172. runs-on: ubuntu-latest
  173. env:
  174. PLATFORM: linux64
  175. OPAMYES: 1
  176. steps:
  177. - uses: actions/checkout@main
  178. with:
  179. submodules: recursive
  180. - name: Install dependencies
  181. run: |
  182. set -ex
  183. sudo add-apt-repository ppa:avsm/ppa -y # provides OPAM 2
  184. sudo add-apt-repository ppa:haxe/ocaml -y # provides newer version of mbedtls
  185. sudo apt-get update -qqy
  186. sudo apt-get install -qqy ocaml-nox camlp5 opam libpcre3-dev zlib1g-dev libgtk2.0-dev libmbedtls-dev ninja-build neko neko-dev
  187. - name: Install OCaml libraries
  188. run: |
  189. set -ex
  190. opam init # --disable-sandboxing
  191. opam update
  192. opam pin add haxe . --no-action
  193. opam install haxe --deps-only
  194. opam list
  195. ocamlopt -v
  196. - name: Build Haxe
  197. run: |
  198. set -ex
  199. eval $(opam env)
  200. opam config exec -- make -s -j`nproc` STATICLINK=1 haxe
  201. opam config exec -- make -s haxelib
  202. make -s package_unix
  203. ls -l out
  204. ldd -v ./haxe
  205. ldd -v ./haxelib
  206. - name: Build xmldoc
  207. run: |
  208. set -ex
  209. make -s xmldoc
  210. cat >extra/doc/info.json <<EOL
  211. {
  212. "commit": "$GITHUB_SHA",
  213. "branch": "$GITHUB_REF"
  214. }
  215. EOL
  216. - name: Upload artifact
  217. uses: actions/[email protected]
  218. with:
  219. name: linuxBinaries
  220. path: out
  221. mac-build:
  222. runs-on: macos-latest
  223. env:
  224. PLATFORM: mac
  225. OPAMYES: 1
  226. steps:
  227. - uses: actions/checkout@main
  228. with:
  229. submodules: recursive
  230. - name: Install Neko using homebrew (Mac)
  231. if: (startsWith(env.PLATFORM, 'mac'))
  232. run: |
  233. set -ex
  234. HOMEBREW_NO_AUTO_UPDATE=1
  235. brew install neko
  236. - name: Print Neko version
  237. run: neko -version 2>&1
  238. - name: Install dependencies
  239. run: |
  240. set -ex
  241. brew uninstall [email protected]
  242. brew uninstall [email protected]
  243. brew untap local/openssl
  244. brew untap local/python2
  245. brew update
  246. # brew unlink python@2
  247. brew bundle --file=tests/Brewfile --no-upgrade || brew link --overwrite awscli
  248. - name: Install OCaml libraries
  249. run: |
  250. set -ex
  251. opam init # --disable-sandboxing
  252. opam update
  253. opam pin add haxe . --no-action
  254. opam install haxe --deps-only
  255. opam list
  256. ocamlopt -v
  257. - name: Build Haxe
  258. run: |
  259. set -ex
  260. eval $(opam env)
  261. opam config exec -- make -s -j`sysctl -n hw.ncpu` STATICLINK=1 "LIB_PARAMS=/usr/local/opt/zlib/lib/libz.a /usr/local/lib/libpcre.a /usr/local/lib/libmbedtls.a /usr/local/lib/libmbedcrypto.a /usr/local/lib/libmbedx509.a -cclib '-framework Security -framework CoreFoundation'" haxe
  262. opam config exec -- make -s haxelib
  263. make -s package_unix package_installer_mac
  264. ls -l out
  265. otool -L ./haxe
  266. otool -L ./haxelib
  267. - name: Upload artifact
  268. uses: actions/[email protected]
  269. with:
  270. name: macBinaries
  271. path: out
  272. windows64-test:
  273. needs: windows64-build
  274. runs-on: windows-latest
  275. env:
  276. ACTIONS_ALLOW_UNSECURE_COMMANDS: true
  277. PLATFORM: windows64
  278. TEST: ${{matrix.target}}
  279. HXCPP_COMPILE_CACHE: ~/hxcache
  280. ARCH: 64
  281. strategy:
  282. fail-fast: false
  283. matrix:
  284. # TODO enable lua after https://github.com/HaxeFoundation/haxe/issues/5024
  285. target: [macro, js, hl, cpp, 'java,jvm', cs, php, python, neko]
  286. steps:
  287. - uses: actions/checkout@main
  288. with:
  289. submodules: recursive
  290. - uses: actions/download-artifact@v1
  291. with:
  292. name: win${{env.ARCH}}Binaries
  293. - name: Install Neko using snapshot from S3 (Windows)
  294. if: startsWith(env.PLATFORM, 'windows')
  295. shell: pwsh
  296. run: |
  297. $DOWNLOADDIR="./temp"
  298. new-item -Name $DOWNLOADDIR -ItemType directory
  299. Invoke-WebRequest https://build.haxe.org/builds/neko/$env:PLATFORM/neko_latest.zip -OutFile $DOWNLOADDIR/neko_latest.zip
  300. Expand-Archive $DOWNLOADDIR/neko_latest.zip -DestinationPath $DOWNLOADDIR
  301. $NEKOPATH = Get-ChildItem $DOWNLOADDIR/neko-*-*
  302. Write-Host "::add-path::$NEKOPATH"
  303. Write-Host "::set-env name=NEKOPATH::$NEKOPATH"
  304. - name: Print Neko version
  305. run: neko -version 2>&1
  306. # - name: Quick test
  307. # shell: pwsh
  308. # run: |
  309. # $DOWNLOADDIR="./win$($env:ARCH)Binaries"
  310. # new-item -Name $DOWNLOADDIR -ItemType directory
  311. # Invoke-WebRequest https://build.haxe.org/builds/haxe/$env:PLATFORM/haxe_latest.zip -OutFile $DOWNLOADDIR/haxe_bin.zip
  312. - name: Setup Haxe
  313. shell: pwsh
  314. run: |
  315. $DOWNLOADDIR="./win$($env:ARCH)Binaries"
  316. Expand-Archive $DOWNLOADDIR/*_bin.zip -DestinationPath $DOWNLOADDIR
  317. Set-PSDebug -Trace 1
  318. $HAXEPATH = Get-ChildItem $DOWNLOADDIR/haxe_*_* -Directory
  319. Write-Host "::add-path::$HAXEPATH"
  320. Write-Host "::set-env name=HAXELIB_ROOT::$HAXEPATH\lib"
  321. - name: Print Haxe version
  322. shell: pwsh
  323. run: haxe -version
  324. - name: "Make Python 3 be available as python3 in the cmdline"
  325. shell: pwsh
  326. run: |
  327. Set-PSDebug -Trace 1
  328. $pypath = python -c "import sys; print(sys.executable)"
  329. $py3path = $pypath.replace("python.exe","python3.exe")
  330. cmd /c mklink $py3path $pypath
  331. python3 -V
  332. - name: Install hererocks
  333. if: matrix.target == 'lua'
  334. shell: cmd
  335. run: |
  336. pip install hererocks
  337. hererocks lua53 -l5.3 -rlatest
  338. call lua53/bin/activate
  339. - name: Setup haxelib
  340. shell: pwsh
  341. run: |
  342. mkdir "$env:HAXELIB_ROOT"
  343. haxelib setup "$env:HAXELIB_ROOT"
  344. - name: Test
  345. shell: pwsh
  346. run: haxe RunCi.hxml
  347. working-directory: ${{github.workspace}}/tests
  348. windows-test:
  349. needs: windows-build
  350. runs-on: windows-latest
  351. env:
  352. ACTIONS_ALLOW_UNSECURE_COMMANDS: true
  353. PLATFORM: windows
  354. TEST: ${{matrix.target}}
  355. HXCPP_COMPILE_CACHE: ~/hxcache
  356. ARCH: 32
  357. strategy:
  358. fail-fast: false
  359. matrix:
  360. # TODO jvm: https://github.com/HaxeFoundation/haxe/issues/8601
  361. # TODO enable lua after https://github.com/HaxeFoundation/haxe/issues/5024
  362. target: [macro, js, hl, cpp, java, cs, php, python, neko]
  363. steps:
  364. - uses: actions/checkout@main
  365. with:
  366. submodules: recursive
  367. - uses: actions/download-artifact@v1
  368. with:
  369. name: win${{env.ARCH}}Binaries
  370. - name: Install Neko using snapshot from S3 (Windows)
  371. if: startsWith(env.PLATFORM, 'windows')
  372. shell: pwsh
  373. run: |
  374. $DOWNLOADDIR="./temp"
  375. new-item -Name $DOWNLOADDIR -ItemType directory
  376. Invoke-WebRequest https://build.haxe.org/builds/neko/$env:PLATFORM/neko_latest.zip -OutFile $DOWNLOADDIR/neko_latest.zip
  377. Expand-Archive $DOWNLOADDIR/neko_latest.zip -DestinationPath $DOWNLOADDIR
  378. $NEKOPATH = Get-ChildItem $DOWNLOADDIR/neko-*-*
  379. Write-Host "::add-path::$NEKOPATH"
  380. Write-Host "::set-env name=NEKOPATH::$NEKOPATH"
  381. - name: Print Neko version
  382. run: neko -version 2>&1
  383. # - name: Quick test
  384. # shell: pwsh
  385. # run: |
  386. # $DOWNLOADDIR="./win$($env:ARCH)Binaries"
  387. # new-item -Name $DOWNLOADDIR -ItemType directory
  388. # Invoke-WebRequest https://build.haxe.org/builds/haxe/$env:PLATFORM/haxe_latest.zip -OutFile $DOWNLOADDIR/haxe_bin.zip
  389. - name: Setup Haxe
  390. shell: pwsh
  391. run: |
  392. $DOWNLOADDIR="./win$($env:ARCH)Binaries"
  393. Expand-Archive $DOWNLOADDIR/*_bin.zip -DestinationPath $DOWNLOADDIR
  394. Set-PSDebug -Trace 1
  395. $HAXEPATH = Get-ChildItem $DOWNLOADDIR/haxe_*_* -Directory
  396. Write-Host "::add-path::$HAXEPATH"
  397. Write-Host "::set-env name=HAXELIB_ROOT::$HAXEPATH\lib"
  398. - name: Print Haxe version
  399. shell: pwsh
  400. run: haxe -version
  401. - name: "Make Python 3 be available as python3 in the cmdline"
  402. shell: pwsh
  403. run: |
  404. Set-PSDebug -Trace 1
  405. $pypath = python -c "import sys; print(sys.executable)"
  406. $py3path = $pypath.replace("python.exe","python3.exe")
  407. cmd /c mklink $py3path $pypath
  408. python3 -V
  409. - name: Install hererocks
  410. if: matrix.target == 'lua'
  411. shell: cmd
  412. run: |
  413. pip install hererocks
  414. hererocks lua53 -l5.3 -rlatest
  415. call lua53/bin/activate
  416. - name: Setup haxelib
  417. shell: pwsh
  418. run: |
  419. mkdir "$env:HAXELIB_ROOT"
  420. haxelib setup "$env:HAXELIB_ROOT"
  421. - name: Test
  422. shell: pwsh
  423. run: haxe RunCi.hxml
  424. working-directory: ${{github.workspace}}/tests
  425. linux-test:
  426. needs: linux-build
  427. runs-on: ubuntu-latest
  428. env:
  429. PLATFORM: linux64
  430. TEST: ${{matrix.target}}
  431. HXCPP_COMPILE_CACHE: ~/hxcache
  432. strategy:
  433. fail-fast: false
  434. matrix:
  435. target: [macro, js, hl, cpp, 'java,jvm', cs, php, python, lua, flash9, neko]
  436. include:
  437. - target: js
  438. # SAUCE: 1
  439. # SAUCE_TUNNEL_ID: 'linux-test'
  440. # SAUCE_BUILD: '${{env.GITHUB_RUN_NUMBER}}' # $(Build.BuildNumber)
  441. - target: hl
  442. APT_PACKAGES: cmake ninja-build libturbojpeg-dev
  443. - target: cpp
  444. APT_PACKAGES: gcc-multilib g++-multilib
  445. - target: lua
  446. APT_PACKAGES: ncurses-dev
  447. - target: flash9
  448. APT_PACKAGES: libglib2.0 libfreetype6 xvfb
  449. steps:
  450. - uses: actions/checkout@main
  451. with:
  452. submodules: recursive
  453. - uses: actions/download-artifact@v1
  454. with:
  455. name: linuxBinaries
  456. - name: Install Neko using apt-get (Linux)
  457. if: (startsWith(env.PLATFORM, 'linux'))
  458. run: |
  459. set -ex
  460. sudo add-apt-repository ppa:haxe/snapshots -y
  461. sudo apt-get update -qqy
  462. sudo apt-get install -qqy neko
  463. - name: Print Neko version
  464. run: neko -version 2>&1
  465. - name: Setup Haxe
  466. run: |
  467. # mkdir ./linuxBinaries
  468. # curl -sSL https://build.haxe.org/builds/haxe/linux64/haxe_latest.tar.gz -o ./linuxBinaries/haxe_bin.tar.gz
  469. sudo apt install -qqy libmbedtls-dev
  470. set -ex
  471. tar -xf linuxBinaries/*_bin.tar.gz -C linuxBinaries --strip-components=1
  472. sudo mkdir -p /usr/local/bin/
  473. sudo mkdir -p /usr/local/share/haxe/
  474. sudo ln -s `pwd`/linuxBinaries/haxe /usr/local/bin/haxe
  475. sudo ln -s `pwd`/linuxBinaries/haxelib /usr/local/bin/haxelib
  476. sudo ln -s `pwd`/linuxBinaries/std /usr/local/share/haxe/std
  477. - name: Print Haxe version
  478. run: haxe -version
  479. - name: Setup haxelib
  480. run: |
  481. set -ex
  482. mkdir ~/haxelib
  483. haxelib setup ~/haxelib
  484. - name: Install apt packages
  485. if: matrix.APT_PACKAGES
  486. run: |
  487. set -ex
  488. sudo apt update -qqy
  489. sudo apt install -qqy ${{matrix.APT_PACKAGES}}
  490. - name: Flash setup
  491. if: matrix.target == 'flash9'
  492. run: export DISPLAY=:99.0
  493. - name: Test
  494. if: success() && !(matrix.SAUCE && matrix.SAUCE_ACCESS_KEY)
  495. run: haxe RunCi.hxml
  496. working-directory: ${{github.workspace}}/tests
  497. - name: Test (with SauceLabs)
  498. if: matrix.target == 'js' && success() && matrix.SAUCE && matrix.SAUCE_ACCESS_KEY
  499. run: haxe RunCi.hxml
  500. working-directory: ${{github.workspace}}/tests
  501. env:
  502. SAUCE_ACCESS_KEY: matrix.SAUCE_ACCESS_KEY
  503. mac-test:
  504. needs: mac-build
  505. runs-on: macos-latest
  506. env:
  507. PLATFORM: mac
  508. TEST: ${{matrix.target}}
  509. HXCPP_COMPILE_CACHE: ~/hxcache
  510. strategy:
  511. fail-fast: false
  512. matrix:
  513. target: [macro, js, hl, cpp, 'java,jvm', cs, php, python, lua, flash9, neko]
  514. include:
  515. - target: hl
  516. BREW_PACKAGES: ninja
  517. steps:
  518. - uses: actions/checkout@main
  519. with:
  520. submodules: recursive
  521. - uses: actions/download-artifact@v1
  522. with:
  523. name: macBinaries
  524. - name: Install Neko using homebrew (Mac)
  525. if: (startsWith(env.PLATFORM, 'mac'))
  526. run: |
  527. set -ex
  528. HOMEBREW_NO_AUTO_UPDATE=1
  529. brew install neko
  530. - name: Print Neko version
  531. run: neko -version 2>&1
  532. - name: Setup Haxe
  533. run: |
  534. # mkdir ./macBinaries
  535. # curl -sSL https://build.haxe.org/builds/haxe/mac/haxe_latest.tar.gz -o ./macBinaries/haxe_bin.tar.gz
  536. set -ex
  537. tar -xf macBinaries/*_bin.tar.gz -C macBinaries --strip-components=1
  538. sudo mkdir -p /usr/local/bin/
  539. sudo mkdir -p /usr/local/share/haxe/
  540. sudo ln -s `pwd`/macBinaries/haxe /usr/local/bin/haxe
  541. sudo ln -s `pwd`/macBinaries/haxelib /usr/local/bin/haxelib
  542. sudo ln -s `pwd`/macBinaries/std /usr/local/share/haxe/std
  543. - name: Print Haxe version
  544. run: haxe -version
  545. - name: Setup haxelib
  546. run: |
  547. set -ex
  548. mkdir ~/haxelib
  549. haxelib setup ~/haxelib
  550. - name: Install homebrew packages
  551. if: matrix.BREW_PACKAGES
  552. run: brew install ${{matrix.BREW_PACKAGES}}
  553. - name: Test
  554. run: |
  555. # disable invalid Unicode filenames on APFS
  556. echo "" > sys/compile-fs.hxml
  557. haxe RunCi.hxml
  558. working-directory: ${{github.workspace}}/tests
  559. deploy:
  560. if: github.event_name != 'pull_request'
  561. needs: [linux-test, mac-test, windows-test, windows64-test]
  562. runs-on: ubuntu-latest
  563. steps:
  564. # this is only needed for to get `COMMIT_DATE`...
  565. # maybe https://github.community/t/expose-commit-timestamp-in-the-github-context-data/16460/3
  566. # would be faster
  567. - name: Checkout the repository
  568. uses: actions/checkout@main
  569. - name: Download build artifacts
  570. uses: actions/download-artifact@v2
  571. - name: Install awscli
  572. run: |
  573. set -ex
  574. sudo apt-get update -qqy
  575. sudo apt-get install -qqy awscli
  576. # https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
  577. - name: Extract branch name
  578. id: extract_branch
  579. shell: bash
  580. run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
  581. - name: Upload binaries
  582. shell: bash
  583. env:
  584. AWS_ACCESS_KEY_ID: ${{ secrets.HXBUILDS_AWS_ACCESS_KEY_ID }}
  585. AWS_SECRET_ACCESS_KEY: ${{ secrets.HXBUILDS_AWS_SECRET_ACCESS_KEY }}
  586. HXBUILDS_S3ADDR: ${{ secrets.HXBUILDS_S3ADDR }}/gh-actions
  587. run: |
  588. set -ex
  589. COMMIT_HASH_SHORT=${GITHUB_SHA:0:7}
  590. COMMIT_DATE=`TZ=UTC git show --quiet --date='format-local:%Y-%m-%d' --format="%cd"`
  591. FILE_NAME=haxe_${COMMIT_DATE}_${{ steps.extract_branch.outputs.branch }}_${COMMIT_HASH_SHORT}
  592. aws s3 cp linuxBinaries/*_bin.tar.gz ${HXBUILDS_S3ADDR}/haxe/linux64/${FILE_NAME}.tar.gz
  593. aws s3 cp macBinaries/*_bin.tar.gz ${HXBUILDS_S3ADDR}/haxe/mac/${FILE_NAME}.tar.gz
  594. aws s3 cp macBinaries/*_installer.tar.gz ${HXBUILDS_S3ADDR}/haxe/mac-installer/${FILE_NAME}.tar.gz
  595. aws s3 cp win64Binaries/*_bin.zip ${HXBUILDS_S3ADDR}/haxe/windows64/${FILE_NAME}.zip
  596. aws s3 cp win64Binaries/*_installer.zip ${HXBUILDS_S3ADDR}/haxe/windows64-installer/${FILE_NAME}.zip
  597. aws s3 cp win64Binaries/*.nupkg ${HXBUILDS_S3ADDR}/haxe/windows64-choco/
  598. aws s3 cp win32Binaries/*_bin.zip ${HXBUILDS_S3ADDR}/haxe/windows/${FILE_NAME}.zip
  599. aws s3 cp win32Binaries/*_installer.zip ${HXBUILDS_S3ADDR}/haxe/windows-installer/${FILE_NAME}.zip
  600. aws s3 cp win32Binaries/*.nupkg ${HXBUILDS_S3ADDR}/haxe/windows-choco/
  601. - name: Update "latest"
  602. if: github.ref == 'refs/heads/development'
  603. shell: bash
  604. env:
  605. AWS_ACCESS_KEY_ID: ${{ secrets.HXBUILDS_AWS_ACCESS_KEY_ID }}
  606. AWS_SECRET_ACCESS_KEY: ${{ secrets.HXBUILDS_AWS_SECRET_ACCESS_KEY }}
  607. HXBUILDS_S3ADDR: ${{ secrets.HXBUILDS_S3ADDR }}/gh-actions
  608. run: |
  609. set -ex
  610. aws s3 cp linuxBinaries/*_bin.tar.gz ${HXBUILDS_S3ADDR}/haxe/linux64/haxe_latest.tar.gz
  611. aws s3 cp macBinaries/*_bin.tar.gz ${HXBUILDS_S3ADDR}/haxe/mac/haxe_latest.tar.gz
  612. aws s3 cp macBinaries/*_installer.tar.gz ${HXBUILDS_S3ADDR}/haxe/mac-installer/haxe_latest.tar.gz
  613. aws s3 cp win64Binaries/*_bin.zip ${HXBUILDS_S3ADDR}/haxe/windows64/haxe_latest.zip
  614. aws s3 cp win64Binaries/*_installer.zip ${HXBUILDS_S3ADDR}/haxe/windows64-installer/haxe_latest.zip
  615. aws s3 cp win32Binaries/*_bin.zip ${HXBUILDS_S3ADDR}/haxe/windows/haxe_latest.zip
  616. aws s3 cp win32Binaries/*_installer.zip ${HXBUILDS_S3ADDR}/haxe/windows-installer/haxe_latest.zip
  617. # Chocolatey packages have to be named with version number,
  618. # so let's use web redirection to keep the original file name.
  619. [[ "$HXBUILDS_S3ADDR" =~ s3://([^/]+)(.*) ]] && HXBUILDS_S3BUCKET="${BASH_REMATCH[1]}" && HXBUILDS_S3PATH="${BASH_REMATCH[2]}"
  620. [[ `echo win64Binaries/*.nupkg` =~ win64Binaries/(.+) ]] && FILE_NAME="${BASH_REMATCH[1]}"
  621. 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}"
  622. [[ `echo win32Binaries/*.nupkg` =~ win32Binaries/(.+) ]] && FILE_NAME="${BASH_REMATCH[1]}"
  623. 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}"