main.yml 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038
  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. windows64-build:
  7. runs-on: windows-latest
  8. env:
  9. ACTIONS_ALLOW_UNSECURE_COMMANDS: true
  10. PLATFORM: windows64
  11. OPAMYES: 1
  12. OPAMROOT: D:\.opam
  13. CYG_MIRROR: http://mirrors.kernel.org/sourceware/cygwin/
  14. ARCH: 64
  15. MINGW_ARCH: x86_64
  16. CYGWIN_SETUP: https://cygwin.com/setup-x86_64.exe
  17. CYG_ROOT: C:/cygwin64
  18. steps:
  19. - uses: actions/checkout@main
  20. with:
  21. submodules: recursive
  22. - name: Use GNU Tar from msys
  23. run: |
  24. echo "C:\msys64\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
  25. rm C:\msys64\usr\bin\bash.exe
  26. - name: Cache opam
  27. id: cache-opam
  28. uses: actions/[email protected]
  29. with:
  30. path: D:\.opam
  31. key: ${{ runner.os }}64-${{ hashFiles('./opam', './libs/') }}
  32. - name: Install Neko from S3
  33. shell: pwsh
  34. run: |
  35. Invoke-WebRequest https://build.haxe.org/builds/neko/$env:PLATFORM/neko_latest.zip -OutFile $env:RUNNER_TEMP/neko_latest.zip
  36. Expand-Archive $env:RUNNER_TEMP/neko_latest.zip -DestinationPath $env:RUNNER_TEMP
  37. $NEKOPATH = Get-ChildItem $env:RUNNER_TEMP/neko-*-*
  38. echo "$NEKOPATH" >> $env:GITHUB_PATH
  39. echo "NEKOPATH=$NEKOPATH" >> $env:GITHUB_ENV
  40. - name: Print Neko version
  41. run: neko -version 2>&1
  42. - name: choco install nsis
  43. uses: nick-invision/retry@v1
  44. with:
  45. timeout_minutes: 10
  46. max_attempts: 10
  47. command: choco install --no-progress nsis.portable --version 3.02 -y
  48. - name: choco install things
  49. shell: pwsh
  50. run: choco install --no-progress curl wget 7zip.portable -y
  51. - name: Prepend Chocolatey path
  52. shell: pwsh
  53. run: Write-Host "::add-path::C:\ProgramData\chocolatey\bin"
  54. - name: Install OCaml
  55. shell: pwsh
  56. run: |
  57. Set-PSDebug -Trace 1
  58. curl.exe -fsSL -o cygwin-setup.exe --retry 3 $($env:CYGWIN_SETUP)
  59. 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 -RedirectStandardOutput cygwin-setup-out.txt
  60. Get-Content cygwin-setup-out.txt
  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', 'curl -L https://cpanmin.us | perl - App::cpanminus')
  64. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cpanm IPC::System::Simple module')
  65. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cpanm String::ShellQuote')
  66. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'echo "$OLDPWD"')
  67. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && tar -C / -xvf libmbedtls.tar.xz')
  68. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && tar -xf opam.tar.xz')
  69. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && bash opam${ARCH}/install.sh')
  70. - name: Install OCaml libraries
  71. if: steps.cache-opam.outputs.cache-hit != 'true'
  72. shell: pwsh
  73. run: |
  74. Set-PSDebug -Trace 1
  75. & "$($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')
  76. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam update --yes 2>&1')
  77. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam pin add haxe . --kind=path --no-action --yes 2>&1')
  78. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam install haxe --deps-only --yes 2>&1')
  79. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam list')
  80. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'ocamlopt -v')
  81. - name: Expose mingw dll files
  82. shell: pwsh
  83. run: Write-Host "::add-path::${env:CYG_ROOT}/usr/$($env:MINGW_ARCH)-w64-mingw32/sys-root/mingw/bin"
  84. # required to be able to retrieve the revision
  85. - name: Mark directory as safe
  86. shell: pwsh
  87. run: |
  88. Set-PSDebug -Trace 1
  89. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'git config --global --add safe.directory "$OLDPWD"')
  90. - name: Set ADD_REVISION=1 for non-release
  91. if: ${{ !startsWith(github.ref, 'refs/tags/') }}
  92. shell: pwsh
  93. run: echo "ADD_REVISION=1" >> $Env:GITHUB_ENV
  94. - name: Build Haxe
  95. shell: pwsh
  96. run: |
  97. Set-PSDebug -Trace 1
  98. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -s -f Makefile.win -j`nproc` haxe 2>&1')
  99. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -s -f Makefile.win haxelib 2>&1')
  100. & "$($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')
  101. dir out
  102. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && cygcheck ./haxe.exe')
  103. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && cygcheck ./haxelib.exe')
  104. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && ls ./out')
  105. - name: Upload artifact
  106. uses: actions/[email protected]
  107. with:
  108. name: win${{env.ARCH}}Binaries
  109. path: out
  110. windows-build:
  111. runs-on: windows-latest
  112. env:
  113. ACTIONS_ALLOW_UNSECURE_COMMANDS: true
  114. PLATFORM: windows
  115. OPAMYES: 1
  116. OPAMROOT: D:\.opam
  117. CYG_MIRROR: http://mirrors.kernel.org/sourceware/cygwin-archive/20221123
  118. ARCH: 32
  119. MINGW_ARCH: i686
  120. CYGWIN_SETUP: https://cygwin.com/setup-x86.exe
  121. CYG_ROOT: C:/cygwin
  122. steps:
  123. - uses: actions/checkout@main
  124. with:
  125. submodules: recursive
  126. - name: Use GNU Tar from msys
  127. run: |
  128. echo "C:\msys64\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
  129. rm C:\msys64\usr\bin\bash.exe
  130. - name: Cache opam
  131. id: cache-opam
  132. uses: actions/[email protected]
  133. with:
  134. path: D:\.opam
  135. key: ${{ runner.os }}32-${{ hashFiles('./opam', './libs/') }}
  136. - name: Install Neko from S3
  137. shell: pwsh
  138. run: |
  139. Invoke-WebRequest https://build.haxe.org/builds/neko/$env:PLATFORM/neko_latest.zip -OutFile $env:RUNNER_TEMP/neko_latest.zip
  140. Expand-Archive $env:RUNNER_TEMP/neko_latest.zip -DestinationPath $env:RUNNER_TEMP
  141. $NEKOPATH = Get-ChildItem $env:RUNNER_TEMP/neko-*-*
  142. echo "$NEKOPATH" >> $env:GITHUB_PATH
  143. echo "NEKOPATH=$NEKOPATH" >> $env:GITHUB_ENV
  144. - name: Print Neko version
  145. run: neko -version 2>&1
  146. - name: choco install nsis
  147. uses: nick-invision/retry@v1
  148. with:
  149. timeout_minutes: 10
  150. max_attempts: 10
  151. command: choco install --no-progress nsis.portable --version 3.02 -y
  152. - name: choco install things
  153. shell: pwsh
  154. run: choco install --no-progress curl wget 7zip.portable -y
  155. - name: Prepend Chocolatey path
  156. shell: pwsh
  157. run: Write-Host "::add-path::C:\ProgramData\chocolatey\bin"
  158. - name: Install OCaml
  159. shell: pwsh
  160. run: |
  161. Set-PSDebug -Trace 1
  162. curl.exe -fsSL -o cygwin-setup.exe --retry 3 $($env:CYGWIN_SETUP)
  163. 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 --allow-unsupported-windows" -Wait -RedirectStandardOutput cygwin-setup-out.txt
  164. Get-Content cygwin-setup-out.txt
  165. & "$($env:CYG_ROOT)/bin/bash.exe" @('--norc', '--noprofile', '/etc/postinstall/ca-certificates.sh')
  166. 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
  167. 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
  168. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'curl -L https://cpanmin.us | perl - App::cpanminus')
  169. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cpanm IPC::System::Simple module')
  170. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cpanm String::ShellQuote')
  171. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'echo "$OLDPWD"')
  172. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && tar -C / -xvf libmbedtls.tar.xz')
  173. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && tar -xf opam.tar.xz')
  174. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && bash opam${ARCH}/install.sh')
  175. - name: Install OCaml libraries
  176. if: steps.cache-opam.outputs.cache-hit != 'true'
  177. shell: pwsh
  178. run: |
  179. Set-PSDebug -Trace 1
  180. & "$($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')
  181. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam update --yes 2>&1')
  182. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam pin add haxe . --kind=path --no-action --yes 2>&1')
  183. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam install haxe --deps-only --yes 2>&1')
  184. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam list')
  185. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'ocamlopt -v')
  186. - name: Expose mingw dll files
  187. shell: pwsh
  188. run: Write-Host "::add-path::${env:CYG_ROOT}/usr/$($env:MINGW_ARCH)-w64-mingw32/sys-root/mingw/bin"
  189. # required to be able to retrieve the revision
  190. - name: Mark directory as safe
  191. shell: pwsh
  192. run: |
  193. Set-PSDebug -Trace 1
  194. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'git config --global --add safe.directory "$OLDPWD"')
  195. - name: Set ADD_REVISION=1 for non-release
  196. if: ${{ !startsWith(github.ref, 'refs/tags/') }}
  197. shell: pwsh
  198. run: echo "ADD_REVISION=1" >> $Env:GITHUB_ENV
  199. - name: Build Haxe
  200. shell: pwsh
  201. run: |
  202. Set-PSDebug -Trace 1
  203. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -s -f Makefile.win -j`nproc` haxe 2>&1')
  204. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam config exec -- make -s -f Makefile.win haxelib 2>&1')
  205. & "$($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')
  206. dir out
  207. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && cygcheck ./haxe.exe')
  208. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && cygcheck ./haxelib.exe')
  209. & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && ls ./out')
  210. - name: Upload artifact
  211. uses: actions/[email protected]
  212. with:
  213. name: win${{env.ARCH}}Binaries
  214. path: out
  215. linux-build:
  216. runs-on: ubuntu-20.04
  217. env:
  218. PLATFORM: linux64
  219. OPAMYES: 1
  220. steps:
  221. - uses: actions/checkout@main
  222. with:
  223. submodules: recursive
  224. - name: Cache opam
  225. id: cache-opam
  226. uses: actions/[email protected]
  227. with:
  228. path: ~/.opam/
  229. key: ${{ runner.os }}-${{ hashFiles('./opam', './libs/') }}-2
  230. - name: Install Neko from S3
  231. run: |
  232. set -ex
  233. curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $RUNNER_TEMP/neko_latest.tar.gz
  234. tar -xf $RUNNER_TEMP/neko_latest.tar.gz -C $RUNNER_TEMP
  235. NEKOPATH=`echo $RUNNER_TEMP/neko-*-*`
  236. sudo mkdir -p /usr/local/bin
  237. sudo mkdir -p /usr/local/lib/neko
  238. sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/
  239. sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/
  240. sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/
  241. echo "NEKOPATH=$NEKOPATH" >> $GITHUB_ENV
  242. - name: Print Neko version
  243. run: neko -version 2>&1
  244. - name: Install dependencies
  245. run: |
  246. set -ex
  247. sudo add-apt-repository ppa:avsm/ppa -y # provides OPAM 2
  248. sudo add-apt-repository ppa:haxe/ocaml -y # provides newer version of mbedtls
  249. sudo apt-get update -qqy
  250. sudo apt-get install -qqy ocaml-nox camlp5 opam libpcre3-dev zlib1g-dev libgtk2.0-dev libmbedtls-dev ninja-build libstring-shellquote-perl libipc-system-simple-perl
  251. - name: Install OCaml libraries
  252. if: steps.cache-opam.outputs.cache-hit != 'true'
  253. run: |
  254. set -ex
  255. opam init # --disable-sandboxing
  256. opam update
  257. opam pin add haxe . --no-action
  258. opam install haxe --deps-only --assume-depexts
  259. opam list
  260. ocamlopt -v
  261. - name: Set ADD_REVISION=1 for non-release
  262. if: ${{ !startsWith(github.ref, 'refs/tags/') }}
  263. run: echo "ADD_REVISION=1" >> $GITHUB_ENV
  264. - name: Build Haxe
  265. run: |
  266. set -ex
  267. eval $(opam env)
  268. opam config exec -- make -s -j`nproc` STATICLINK=1 haxe
  269. opam config exec -- make -s haxelib
  270. make -s package_unix
  271. ls -l out
  272. ldd -v ./haxe
  273. ldd -v ./haxelib
  274. # https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
  275. - name: Extract branch name
  276. id: extract_branch
  277. shell: bash
  278. run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
  279. - name: Build xmldoc
  280. run: |
  281. set -ex
  282. make -s xmldoc
  283. cat >extra/doc/info.json <<EOL
  284. {
  285. "commit": "$GITHUB_SHA",
  286. "branch": "${{ steps.extract_branch.outputs.branch }}"
  287. }
  288. EOL
  289. - name: Upload artifact
  290. uses: actions/[email protected]
  291. with:
  292. name: linuxBinaries
  293. path: out
  294. - name: Upload xmldoc artifact
  295. uses: actions/[email protected]
  296. with:
  297. name: xmldoc
  298. path: extra/doc
  299. linux-test:
  300. needs: linux-build
  301. runs-on: ubuntu-20.04
  302. env:
  303. PLATFORM: linux64
  304. TEST: ${{matrix.target}}
  305. HXCPP_COMPILE_CACHE: ~/hxcache
  306. strategy:
  307. fail-fast: false
  308. matrix:
  309. target: [macro, js, hl, cpp, 'java,jvm', cs, php, python, lua, flash, neko]
  310. include:
  311. - target: hl
  312. APT_PACKAGES: cmake ninja-build libturbojpeg-dev
  313. - target: cpp
  314. APT_PACKAGES: gcc-multilib g++-multilib
  315. - target: lua
  316. APT_PACKAGES: ncurses-dev
  317. - target: flash
  318. APT_PACKAGES: libglib2.0-0 libgtk2.0-0 libfreetype6 xvfb
  319. steps:
  320. - uses: actions/checkout@main
  321. with:
  322. submodules: recursive
  323. - uses: actions/download-artifact@v1
  324. with:
  325. name: linuxBinaries
  326. - name: Install Neko from S3
  327. run: |
  328. set -ex
  329. curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $RUNNER_TEMP/neko_latest.tar.gz
  330. tar -xf $RUNNER_TEMP/neko_latest.tar.gz -C $RUNNER_TEMP
  331. NEKOPATH=`echo $RUNNER_TEMP/neko-*-*`
  332. sudo mkdir -p /usr/local/bin
  333. sudo mkdir -p /usr/local/lib/neko
  334. sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/
  335. sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/
  336. sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/
  337. echo "NEKOPATH=$NEKOPATH" >> $GITHUB_ENV
  338. - name: Print Neko version
  339. run: neko -version 2>&1
  340. - name: Setup Haxe
  341. run: |
  342. sudo apt install -qqy libmbedtls-dev
  343. set -ex
  344. tar -xf linuxBinaries/*_bin.tar.gz -C linuxBinaries --strip-components=1
  345. sudo mkdir -p /usr/local/bin/
  346. sudo mkdir -p /usr/local/share/haxe/
  347. sudo ln -s `pwd`/linuxBinaries/haxe /usr/local/bin/haxe
  348. sudo ln -s `pwd`/linuxBinaries/haxelib /usr/local/bin/haxelib
  349. sudo ln -s `pwd`/linuxBinaries/std /usr/local/share/haxe/std
  350. - name: Print Haxe version
  351. run: haxe -version
  352. - name: Setup haxelib
  353. run: |
  354. set -ex
  355. mkdir ~/haxelib
  356. haxelib setup ~/haxelib
  357. - name: Install apt packages
  358. if: matrix.APT_PACKAGES
  359. run: |
  360. set -ex
  361. sudo apt update -qqy
  362. sudo apt install -qqy ${{matrix.APT_PACKAGES}}
  363. - name: Flash setup
  364. if: matrix.target == 'flash'
  365. run: export DISPLAY=:99.0
  366. - name: Test
  367. run: haxe RunCi.hxml
  368. working-directory: ${{github.workspace}}/tests
  369. test-docgen:
  370. needs: linux-build
  371. runs-on: ubuntu-20.04
  372. env:
  373. PLATFORM: linux64
  374. HXCPP_COMPILE_CACHE: ~/hxcache
  375. steps:
  376. - uses: actions/checkout@main
  377. with:
  378. submodules: recursive
  379. - uses: actions/download-artifact@v1
  380. with:
  381. name: linuxBinaries
  382. - name: Download xmldoc artifact
  383. uses: actions/download-artifact@v2
  384. with:
  385. name: xmldoc
  386. path: xmldoc
  387. - name: Install Neko from S3
  388. run: |
  389. set -ex
  390. curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $RUNNER_TEMP/neko_latest.tar.gz
  391. tar -xf $RUNNER_TEMP/neko_latest.tar.gz -C $RUNNER_TEMP
  392. NEKOPATH=`echo $RUNNER_TEMP/neko-*-*`
  393. sudo mkdir -p /usr/local/bin
  394. sudo mkdir -p /usr/local/lib/neko
  395. sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/
  396. sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/
  397. sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/
  398. echo "NEKOPATH=$NEKOPATH" >> $GITHUB_ENV
  399. - name: Print Neko version
  400. run: neko -version 2>&1
  401. - name: Setup Haxe
  402. run: |
  403. sudo apt install -qqy libmbedtls-dev
  404. set -ex
  405. tar -xf linuxBinaries/*_bin.tar.gz -C linuxBinaries --strip-components=1
  406. sudo mkdir -p /usr/local/bin/
  407. sudo mkdir -p /usr/local/share/haxe/
  408. sudo ln -s `pwd`/linuxBinaries/haxe /usr/local/bin/haxe
  409. sudo ln -s `pwd`/linuxBinaries/haxelib /usr/local/bin/haxelib
  410. sudo ln -s `pwd`/linuxBinaries/std /usr/local/share/haxe/std
  411. - name: Print Haxe version
  412. run: haxe -version
  413. - name: Setup haxelib
  414. run: |
  415. set -ex
  416. mkdir ~/haxelib
  417. haxelib setup ~/haxelib
  418. - name: Test documentation generation
  419. run: |
  420. set -ex
  421. haxelib git dox https://github.com/HaxeFoundation/dox.git
  422. haxelib git hxtemplo https://github.com/Simn/hxtemplo.git
  423. haxelib git hxargs https://github.com/Simn/hxargs.git
  424. haxelib git markdown https://github.com/dpeek/haxe-markdown.git
  425. haxelib git hxcpp https://github.com/HaxeFoundation/hxcpp.git
  426. cd $(haxelib libpath hxcpp)/tools/hxcpp
  427. haxe compile.hxml
  428. cd -
  429. haxe dox.hxml
  430. mkdir resources
  431. cp ../../src-json/* resources
  432. cpp/Dox -i ../../xmldoc -ex microsoft -ex javax -ex cs.internal -theme $(haxelib libpath dox)/themes/default
  433. working-directory: ${{github.workspace}}/tests/docgen
  434. linux-arm64:
  435. runs-on: ubuntu-20.04
  436. permissions:
  437. packages: write
  438. env:
  439. FORCE_COLOR: 1
  440. steps:
  441. - name: Login to GitHub Container Registry
  442. uses: docker/login-action@v1
  443. with:
  444. registry: ghcr.io
  445. username: ${{ github.actor }}
  446. password: ${{ secrets.GITHUB_TOKEN }}
  447. - name: Install Earthly
  448. run: sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/download/v0.6.13/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly && /usr/local/bin/earthly bootstrap --with-autocomplete'
  449. - name: Set up QEMU
  450. id: qemu
  451. uses: docker/setup-qemu-action@v1
  452. with:
  453. image: tonistiigi/binfmt:latest
  454. platforms: all
  455. - uses: actions/checkout@main
  456. with:
  457. submodules: recursive
  458. - name: Set CONTAINER_ vars
  459. run: |
  460. echo "CONTAINER_REG=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV;
  461. echo "CONTAINER_TAG=$(echo ${{ github.ref_name }} | sed -e 's/[^A-Za-z0-9\.]/-/g')" >> $GITHUB_ENV;
  462. - name: Build devcontainer
  463. run: earthly --platform=linux/arm64 +devcontainer --IMAGE_NAME="ghcr.io/${CONTAINER_REG}_devcontainer" --IMAGE_TAG="${CONTAINER_TAG}-arm64" --IMAGE_CACHE="ghcr.io/haxefoundation/haxe_devcontainer:development-arm64"
  464. env:
  465. EARTHLY_PUSH: "${{ github.event_name == 'push' }}"
  466. EARTHLY_USE_INLINE_CACHE: true
  467. EARTHLY_SAVE_INLINE_CACHE: true
  468. - name: Set ADD_REVISION=1 for non-release
  469. if: ${{ !startsWith(github.ref, 'refs/tags/') }}
  470. run: echo "ADD_REVISION=1" >> $GITHUB_ENV
  471. - name: Build
  472. run: earthly --platform=linux/arm64 +build --ADD_REVISION="$ADD_REVISION" --SET_SAFE_DIRECTORY="true"
  473. env:
  474. EARTHLY_PUSH: "${{ github.event_name == 'push' }}"
  475. EARTHLY_REMOTE_CACHE: "ghcr.io/${{env.CONTAINER_REG}}_cache:build-${{env.CONTAINER_TAG}}-arm64"
  476. - name: Upload artifact
  477. uses: actions/[email protected]
  478. with:
  479. name: linuxArm64Binaries
  480. path: out/linux/arm64
  481. mac-build:
  482. runs-on: macos-latest
  483. env:
  484. PLATFORM: mac
  485. OPAMYES: 1
  486. MACOSX_DEPLOYMENT_TARGET: 10.13
  487. steps:
  488. - uses: actions/checkout@main
  489. with:
  490. submodules: recursive
  491. - name: Cache opam
  492. id: cache-opam
  493. uses: actions/[email protected]
  494. with:
  495. path: ~/.opam/
  496. key: ${{ runner.os }}-${{ hashFiles('./opam', './libs/') }}-1
  497. - name: Install Neko from S3
  498. run: |
  499. set -ex
  500. curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $RUNNER_TEMP/neko_latest.tar.gz
  501. tar -xf $RUNNER_TEMP/neko_latest.tar.gz -C $RUNNER_TEMP
  502. NEKOPATH=`echo $RUNNER_TEMP/neko-*-*`
  503. sudo mkdir -p /usr/local/bin
  504. sudo mkdir -p /usr/local/lib/neko
  505. sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/
  506. sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/
  507. sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/
  508. echo "NEKOPATH=$NEKOPATH" >> $GITHUB_ENV
  509. - name: Print Neko version
  510. run: neko -version 2>&1
  511. - name: Install dependencies
  512. env:
  513. # For compatibility with macOS 10.13
  514. ZLIB_VERSION: 1.2.13
  515. MBEDTLS_VERSION: 2.25.0
  516. PCRE_VERSION: 8.44
  517. run: |
  518. set -ex
  519. brew uninstall [email protected] || echo
  520. brew uninstall [email protected] || echo
  521. brew untap local/openssl || echo
  522. brew untap local/python2 || echo
  523. brew update
  524. # brew unlink python@2
  525. brew bundle --file=tests/Brewfile --no-upgrade || brew link --overwrite awscli
  526. brew install libunistring
  527. brew install cpanminus
  528. cpanm IPC::System::Simple
  529. cpanm String::ShellQuote
  530. curl -L https://www.zlib.net/zlib-$ZLIB_VERSION.tar.gz | tar xz
  531. cd zlib-$ZLIB_VERSION
  532. ./configure
  533. make && make install
  534. cd ..
  535. curl -L https://github.com/ARMmbed/mbedtls/archive/v$MBEDTLS_VERSION.tar.gz | tar xz
  536. cd mbedtls-$MBEDTLS_VERSION
  537. make && make install
  538. cd ..
  539. curl -L https://downloads.sourceforge.net/project/pcre/pcre/$PCRE_VERSION/pcre-$PCRE_VERSION.tar.gz | tar xz
  540. cd pcre-$PCRE_VERSION
  541. ./configure --enable-utf8 --enable-pcre8 --enable-pcre16 --enable-pcre32 --enable-unicode-properties --enable-pcregrep-libz --enable-pcregrep-libbz2 --enable-jit
  542. make && make install
  543. cd ..
  544. - name: Install OCaml libraries
  545. if: steps.cache-opam.outputs.cache-hit != 'true'
  546. run: |
  547. set -ex
  548. opam init # --disable-sandboxing
  549. opam update
  550. opam switch create 4.07.1
  551. eval $(opam env)
  552. opam env
  553. opam pin add ctypes 0.17.1 --yes
  554. opam pin add haxe . --no-action
  555. opam install haxe --deps-only --assume-depexts
  556. opam list
  557. ocamlopt -v
  558. - name: Set ADD_REVISION=1 for non-release
  559. if: ${{ !startsWith(github.ref, 'refs/tags/') }}
  560. run: echo "ADD_REVISION=1" >> $GITHUB_ENV
  561. - name: Build Haxe
  562. run: |
  563. set -ex
  564. eval $(opam env)
  565. opam config exec -- make -s -j`sysctl -n hw.ncpu` STATICLINK=1 "LIB_PARAMS=/usr/local/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
  566. opam config exec -- make -s haxelib
  567. make -s package_unix package_installer_mac
  568. ls -l out
  569. otool -L ./haxe
  570. otool -L ./haxelib
  571. - name: Upload artifact
  572. uses: actions/[email protected]
  573. with:
  574. name: macBinaries
  575. path: out
  576. windows64-test:
  577. needs: windows64-build
  578. runs-on: windows-latest
  579. env:
  580. ACTIONS_ALLOW_UNSECURE_COMMANDS: true
  581. PLATFORM: windows64
  582. TEST: ${{matrix.target}}
  583. HXCPP_COMPILE_CACHE: ~/hxcache
  584. ARCH: 64
  585. strategy:
  586. fail-fast: false
  587. matrix:
  588. # TODO enable lua after https://github.com/HaxeFoundation/haxe/issues/10919
  589. target: [macro, js, hl, cpp, 'java,jvm', cs, php, python, flash, neko]
  590. steps:
  591. - uses: actions/checkout@main
  592. with:
  593. submodules: recursive
  594. - uses: actions/download-artifact@v1
  595. with:
  596. name: win${{env.ARCH}}Binaries
  597. - name: Install Neko from S3
  598. shell: pwsh
  599. run: |
  600. Invoke-WebRequest https://build.haxe.org/builds/neko/$env:PLATFORM/neko_latest.zip -OutFile $env:RUNNER_TEMP/neko_latest.zip
  601. Expand-Archive $env:RUNNER_TEMP/neko_latest.zip -DestinationPath $env:RUNNER_TEMP
  602. $NEKOPATH = Get-ChildItem $env:RUNNER_TEMP/neko-*-*
  603. echo "$NEKOPATH" >> $env:GITHUB_PATH
  604. echo "NEKOPATH=$NEKOPATH" >> $env:GITHUB_ENV
  605. - name: Print Neko version
  606. run: neko -version 2>&1
  607. # - name: Quick test
  608. # shell: pwsh
  609. # run: |
  610. # $DOWNLOADDIR="./win$($env:ARCH)Binaries"
  611. # new-item -Name $DOWNLOADDIR -ItemType directory
  612. # Invoke-WebRequest https://build.haxe.org/builds/haxe/$env:PLATFORM/haxe_latest.zip -OutFile $DOWNLOADDIR/haxe_bin.zip
  613. - name: Setup Haxe
  614. shell: pwsh
  615. run: |
  616. $DOWNLOADDIR="./win$($env:ARCH)Binaries"
  617. Expand-Archive $DOWNLOADDIR/*_bin.zip -DestinationPath $DOWNLOADDIR
  618. Set-PSDebug -Trace 1
  619. $HAXEPATH = Get-ChildItem $DOWNLOADDIR/haxe_*_* -Directory
  620. Write-Host "::add-path::$HAXEPATH"
  621. Write-Host "::set-env name=HAXELIB_ROOT::$HAXEPATH\lib"
  622. - name: Print Haxe version
  623. shell: pwsh
  624. run: haxe -version
  625. - name: "Make Python 3 be available as python3 in the cmdline"
  626. shell: pwsh
  627. run: |
  628. Set-PSDebug -Trace 1
  629. $pypath = python -c "import sys; print(sys.executable)"
  630. $py3path = $pypath.replace("python.exe","python3.exe")
  631. cmd /c mklink $py3path $pypath
  632. python3 -V
  633. - name: Install hererocks
  634. if: matrix.target == 'lua'
  635. shell: cmd
  636. run: |
  637. pip install hererocks
  638. hererocks lua53 -l5.3 -rlatest
  639. call lua53/bin/activate
  640. - name: Install wget
  641. if: matrix.target == 'flash'
  642. shell: cmd
  643. run: |
  644. choco install wget
  645. wget --version
  646. - name: Setup haxelib
  647. shell: pwsh
  648. run: |
  649. mkdir "$env:HAXELIB_ROOT"
  650. haxelib setup "$env:HAXELIB_ROOT"
  651. - name: Test
  652. shell: pwsh
  653. run: haxe RunCi.hxml
  654. working-directory: ${{github.workspace}}/tests
  655. windows-test:
  656. needs: windows-build
  657. runs-on: windows-latest
  658. env:
  659. ACTIONS_ALLOW_UNSECURE_COMMANDS: true
  660. PLATFORM: windows
  661. TEST: ${{matrix.target}}
  662. HXCPP_COMPILE_CACHE: ~/hxcache
  663. ARCH: 32
  664. strategy:
  665. fail-fast: false
  666. matrix:
  667. # TODO jvm: https://github.com/HaxeFoundation/haxe/issues/8601
  668. # TODO enable lua after https://github.com/HaxeFoundation/haxe/issues/10919
  669. target: [macro, js, hl, cpp, java, cs, php, python, flash, neko]
  670. steps:
  671. - uses: actions/checkout@main
  672. with:
  673. submodules: recursive
  674. - uses: actions/download-artifact@v1
  675. with:
  676. name: win${{env.ARCH}}Binaries
  677. - name: Install Neko from S3
  678. shell: pwsh
  679. run: |
  680. Invoke-WebRequest https://build.haxe.org/builds/neko/$env:PLATFORM/neko_latest.zip -OutFile $env:RUNNER_TEMP/neko_latest.zip
  681. Expand-Archive $env:RUNNER_TEMP/neko_latest.zip -DestinationPath $env:RUNNER_TEMP
  682. $NEKOPATH = Get-ChildItem $env:RUNNER_TEMP/neko-*-*
  683. echo "$NEKOPATH" >> $env:GITHUB_PATH
  684. echo "NEKOPATH=$NEKOPATH" >> $env:GITHUB_ENV
  685. - name: Print Neko version
  686. run: neko -version 2>&1
  687. # - name: Quick test
  688. # shell: pwsh
  689. # run: |
  690. # $DOWNLOADDIR="./win$($env:ARCH)Binaries"
  691. # new-item -Name $DOWNLOADDIR -ItemType directory
  692. # Invoke-WebRequest https://build.haxe.org/builds/haxe/$env:PLATFORM/haxe_latest.zip -OutFile $DOWNLOADDIR/haxe_bin.zip
  693. - name: Setup Haxe
  694. shell: pwsh
  695. run: |
  696. $DOWNLOADDIR="./win$($env:ARCH)Binaries"
  697. Expand-Archive $DOWNLOADDIR/*_bin.zip -DestinationPath $DOWNLOADDIR
  698. Set-PSDebug -Trace 1
  699. $HAXEPATH = Get-ChildItem $DOWNLOADDIR/haxe_*_* -Directory
  700. Write-Host "::add-path::$HAXEPATH"
  701. Write-Host "::set-env name=HAXELIB_ROOT::$HAXEPATH\lib"
  702. - name: Print Haxe version
  703. shell: pwsh
  704. run: haxe -version
  705. - name: "Make Python 3 be available as python3 in the cmdline"
  706. shell: pwsh
  707. run: |
  708. Set-PSDebug -Trace 1
  709. $pypath = python -c "import sys; print(sys.executable)"
  710. $py3path = $pypath.replace("python.exe","python3.exe")
  711. cmd /c mklink $py3path $pypath
  712. python3 -V
  713. - name: Install hererocks
  714. if: matrix.target == 'lua'
  715. shell: cmd
  716. run: |
  717. pip install hererocks
  718. hererocks lua53 -l5.3 -rlatest
  719. call lua53/bin/activate
  720. - name: Install wget
  721. if: matrix.target == 'flash'
  722. shell: cmd
  723. run: |
  724. choco install wget
  725. wget --version
  726. - name: Setup haxelib
  727. shell: pwsh
  728. run: |
  729. mkdir "$env:HAXELIB_ROOT"
  730. haxelib setup "$env:HAXELIB_ROOT"
  731. - name: Test
  732. shell: pwsh
  733. run: haxe RunCi.hxml
  734. working-directory: ${{github.workspace}}/tests
  735. mac-test:
  736. needs: mac-build
  737. runs-on: macos-latest
  738. env:
  739. PLATFORM: mac
  740. TEST: ${{matrix.target}}
  741. HXCPP_COMPILE_CACHE: ~/hxcache
  742. strategy:
  743. fail-fast: false
  744. matrix:
  745. target: [macro, js, hl, cpp, 'java,jvm', cs, php, python, flash, neko]
  746. include:
  747. - target: hl
  748. BREW_PACKAGES: ninja
  749. steps:
  750. - uses: actions/checkout@main
  751. with:
  752. submodules: recursive
  753. - uses: actions/download-artifact@v1
  754. with:
  755. name: macBinaries
  756. - name: Install Neko from S3
  757. run: |
  758. set -ex
  759. curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $RUNNER_TEMP/neko_latest.tar.gz
  760. tar -xf $RUNNER_TEMP/neko_latest.tar.gz -C $RUNNER_TEMP
  761. NEKOPATH=`echo $RUNNER_TEMP/neko-*-*`
  762. sudo mkdir -p /usr/local/bin
  763. sudo mkdir -p /usr/local/lib/neko
  764. sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/
  765. sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/
  766. sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/
  767. echo "NEKOPATH=$NEKOPATH" >> $GITHUB_ENV
  768. - name: Print Neko version
  769. run: neko -version 2>&1
  770. - name: Setup Haxe
  771. run: |
  772. # mkdir ./macBinaries
  773. # curl -sSL https://build.haxe.org/builds/haxe/mac/haxe_latest.tar.gz -o ./macBinaries/haxe_bin.tar.gz
  774. set -ex
  775. tar -xf macBinaries/*_bin.tar.gz -C macBinaries --strip-components=1
  776. sudo mkdir -p /usr/local/bin/
  777. sudo mkdir -p /usr/local/share/haxe/
  778. sudo ln -s `pwd`/macBinaries/haxe /usr/local/bin/haxe
  779. sudo ln -s `pwd`/macBinaries/haxelib /usr/local/bin/haxelib
  780. sudo ln -s `pwd`/macBinaries/std /usr/local/share/haxe/std
  781. - name: Print Haxe version
  782. run: haxe -version
  783. - name: Setup haxelib
  784. run: |
  785. set -ex
  786. mkdir ~/haxelib
  787. haxelib setup ~/haxelib
  788. - name: Install homebrew packages
  789. if: matrix.BREW_PACKAGES
  790. run: brew install ${{matrix.BREW_PACKAGES}}
  791. - name: Test
  792. run: |
  793. # disable invalid Unicode filenames on APFS
  794. echo "" > sys/compile-fs.hxml
  795. haxe RunCi.hxml
  796. working-directory: ${{github.workspace}}/tests
  797. deploy:
  798. if: success() && github.repository_owner == 'HaxeFoundation' && github.event_name != 'pull_request'
  799. needs: [linux-test, linux-arm64, mac-test, windows-test, windows64-test]
  800. runs-on: ubuntu-20.04
  801. steps:
  802. # this is only needed for to get `COMMIT_DATE`...
  803. # maybe https://github.community/t/expose-commit-timestamp-in-the-github-context-data/16460/3
  804. # would be faster
  805. - name: Checkout the repository
  806. uses: actions/checkout@main
  807. - name: Download build artifacts
  808. uses: actions/download-artifact@v2
  809. - name: Install awscli
  810. run: |
  811. set -ex
  812. sudo apt-get update -qqy
  813. sudo apt-get install -qqy awscli
  814. # https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
  815. - name: Extract branch name
  816. id: extract_branch
  817. shell: bash
  818. run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
  819. - name: Upload binaries
  820. shell: bash
  821. env:
  822. AWS_ACCESS_KEY_ID: ${{ secrets.HXBUILDS_AWS_ACCESS_KEY_ID }}
  823. AWS_SECRET_ACCESS_KEY: ${{ secrets.HXBUILDS_AWS_SECRET_ACCESS_KEY }}
  824. HXBUILDS_S3ADDR: ${{ secrets.HXBUILDS_S3ADDR }}
  825. AWS_EC2_METADATA_DISABLED: true
  826. run: |
  827. set -ex
  828. COMMIT_HASH_SHORT=${GITHUB_SHA:0:7}
  829. COMMIT_DATE=`TZ=UTC git show --quiet --date='format-local:%Y-%m-%d' --format="%cd"`
  830. FILE_NAME=haxe_${COMMIT_DATE}_${{ steps.extract_branch.outputs.branch }}_${COMMIT_HASH_SHORT}
  831. aws s3 cp linuxBinaries/*_bin.tar.gz ${HXBUILDS_S3ADDR}/haxe/linux64/${FILE_NAME}.tar.gz
  832. aws s3 cp linuxArm64Binaries/*_bin.tar.gz ${HXBUILDS_S3ADDR}/haxe/linux-arm64/${FILE_NAME}.tar.gz
  833. aws s3 cp macBinaries/*_bin.tar.gz ${HXBUILDS_S3ADDR}/haxe/mac/${FILE_NAME}.tar.gz
  834. aws s3 cp macBinaries/*_installer.tar.gz ${HXBUILDS_S3ADDR}/haxe/mac-installer/${FILE_NAME}.tar.gz
  835. aws s3 cp win64Binaries/*_bin.zip ${HXBUILDS_S3ADDR}/haxe/windows64/${FILE_NAME}.zip
  836. aws s3 cp win64Binaries/*_installer.zip ${HXBUILDS_S3ADDR}/haxe/windows64-installer/${FILE_NAME}.zip
  837. aws s3 cp win64Binaries/*.nupkg ${HXBUILDS_S3ADDR}/haxe/windows64-choco/
  838. aws s3 cp win32Binaries/*_bin.zip ${HXBUILDS_S3ADDR}/haxe/windows/${FILE_NAME}.zip
  839. aws s3 cp win32Binaries/*_installer.zip ${HXBUILDS_S3ADDR}/haxe/windows-installer/${FILE_NAME}.zip
  840. aws s3 cp win32Binaries/*.nupkg ${HXBUILDS_S3ADDR}/haxe/windows-choco/
  841. - name: Update "latest"
  842. if: github.ref == 'refs/heads/development'
  843. shell: bash
  844. env:
  845. AWS_ACCESS_KEY_ID: ${{ secrets.HXBUILDS_AWS_ACCESS_KEY_ID }}
  846. AWS_SECRET_ACCESS_KEY: ${{ secrets.HXBUILDS_AWS_SECRET_ACCESS_KEY }}
  847. HXBUILDS_S3ADDR: ${{ secrets.HXBUILDS_S3ADDR }}
  848. AWS_EC2_METADATA_DISABLED: true
  849. run: |
  850. set -ex
  851. aws s3 cp linuxBinaries/*_bin.tar.gz ${HXBUILDS_S3ADDR}/haxe/linux64/haxe_latest.tar.gz
  852. aws s3 cp linuxArm64Binaries/*_bin.tar.gz ${HXBUILDS_S3ADDR}/haxe/linux-arm64/haxe_latest.tar.gz
  853. aws s3 cp macBinaries/*_bin.tar.gz ${HXBUILDS_S3ADDR}/haxe/mac/haxe_latest.tar.gz
  854. aws s3 cp macBinaries/*_installer.tar.gz ${HXBUILDS_S3ADDR}/haxe/mac-installer/haxe_latest.tar.gz
  855. aws s3 cp win64Binaries/*_bin.zip ${HXBUILDS_S3ADDR}/haxe/windows64/haxe_latest.zip
  856. aws s3 cp win64Binaries/*_installer.zip ${HXBUILDS_S3ADDR}/haxe/windows64-installer/haxe_latest.zip
  857. aws s3 cp win32Binaries/*_bin.zip ${HXBUILDS_S3ADDR}/haxe/windows/haxe_latest.zip
  858. aws s3 cp win32Binaries/*_installer.zip ${HXBUILDS_S3ADDR}/haxe/windows-installer/haxe_latest.zip
  859. # Chocolatey packages have to be named with version number,
  860. # so let's use web redirection to keep the original file name.
  861. [[ "$HXBUILDS_S3ADDR" =~ s3://([^/]+)(.*) ]] && HXBUILDS_S3BUCKET="${BASH_REMATCH[1]}" && HXBUILDS_S3PATH="${BASH_REMATCH[2]}"
  862. [[ `echo win64Binaries/*.nupkg` =~ win64Binaries/(.+) ]] && FILE_NAME="${BASH_REMATCH[1]}"
  863. 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}"
  864. [[ `echo win32Binaries/*.nupkg` =~ win32Binaries/(.+) ]] && FILE_NAME="${BASH_REMATCH[1]}"
  865. 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}"
  866. deploy_apidoc:
  867. if: success() && github.repository_owner == 'HaxeFoundation' && github.event_name != 'pull_request'
  868. needs: [linux-test, linux-arm64, mac-test, windows-test, windows64-test]
  869. runs-on: ubuntu-20.04
  870. steps:
  871. - name: Install dependencies
  872. run: |
  873. set -ex
  874. sudo apt-get install -qqy libc6
  875. - name: Download Haxe
  876. uses: actions/download-artifact@v2
  877. with:
  878. name: linuxBinaries
  879. path: linuxBinaries
  880. - name: Setup Haxe
  881. run: |
  882. set -ex
  883. tar -xf linuxBinaries/*_bin.tar.gz -C linuxBinaries --strip-components=1
  884. sudo mkdir -p /usr/local/bin/
  885. sudo mkdir -p /usr/local/share/haxe/
  886. sudo ln -s `pwd`/linuxBinaries/haxe /usr/local/bin/haxe
  887. sudo ln -s `pwd`/linuxBinaries/haxelib /usr/local/bin/haxelib
  888. sudo ln -s `pwd`/linuxBinaries/std /usr/local/share/haxe/std
  889. - name: Download xmldoc artifact
  890. uses: actions/download-artifact@v2
  891. with:
  892. name: xmldoc
  893. path: xmldoc
  894. - name: Deploy to api.haxe.org
  895. env:
  896. GHP_EMAIL: [email protected]
  897. GHP_USERNAME: Haxe CI Bot
  898. GHP_REMOTE: ${{ secrets.GHP_REMOTE }}
  899. run: |
  900. set -ex
  901. LOCAL="`pwd`/extra/api.haxe.org"
  902. git clone "${GHP_REMOTE}" "${LOCAL}"
  903. haxe --cwd "${LOCAL}" --run ImportXml "`pwd`/xmldoc"