main.yml 40 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040
  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 libpcre2-devel -P mbedtls-devel -P mingw64-$($env:MINGW_ARCH)-zlib -P mingw64-$($env:MINGW_ARCH)-gcc-core -P mingw64-$($env:MINGW_ARCH)-pcre2" -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 libpcre2-devel -P mbedtls-devel -P mingw64-$($env:MINGW_ARCH)-zlib -P mingw64-$($env:MINGW_ARCH)-gcc-core -P mingw64-$($env:MINGW_ARCH)-pcre2 --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-18.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/') }}-1
  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 libpcre2-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-18.04
  302. env:
  303. PLATFORM: linux64
  304. TEST: ${{matrix.target}}
  305. HXCPP_COMPILE_CACHE: ~/hxcache
  306. HAXE_STD_PATH: /usr/local/share/haxe/std
  307. strategy:
  308. fail-fast: false
  309. matrix:
  310. target: [macro, js, hl, cpp, 'java,jvm', cs, php, python, lua, flash, neko]
  311. include:
  312. - target: hl
  313. APT_PACKAGES: cmake ninja-build libturbojpeg-dev
  314. - target: cpp
  315. APT_PACKAGES: gcc-multilib g++-multilib
  316. - target: lua
  317. APT_PACKAGES: ncurses-dev
  318. - target: flash
  319. APT_PACKAGES: libglib2.0-0 libfreetype6 xvfb
  320. steps:
  321. - uses: actions/checkout@main
  322. with:
  323. submodules: recursive
  324. - uses: actions/download-artifact@v1
  325. with:
  326. name: linuxBinaries
  327. - name: Install Neko from S3
  328. run: |
  329. set -ex
  330. curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $RUNNER_TEMP/neko_latest.tar.gz
  331. tar -xf $RUNNER_TEMP/neko_latest.tar.gz -C $RUNNER_TEMP
  332. NEKOPATH=`echo $RUNNER_TEMP/neko-*-*`
  333. sudo mkdir -p /usr/local/bin
  334. sudo mkdir -p /usr/local/lib/neko
  335. sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/
  336. sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/
  337. sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/
  338. echo "NEKOPATH=$NEKOPATH" >> $GITHUB_ENV
  339. - name: Print Neko version
  340. run: neko -version 2>&1
  341. - name: Setup Haxe
  342. run: |
  343. sudo apt install -qqy libmbedtls-dev
  344. set -ex
  345. tar -xf linuxBinaries/*_bin.tar.gz -C linuxBinaries --strip-components=1
  346. sudo mkdir -p /usr/local/bin/
  347. sudo mkdir -p /usr/local/share/haxe/
  348. sudo ln -s `pwd`/linuxBinaries/haxe /usr/local/bin/haxe
  349. sudo ln -s `pwd`/linuxBinaries/haxelib /usr/local/bin/haxelib
  350. sudo ln -s `pwd`/linuxBinaries/std /usr/local/share/haxe/std
  351. - name: Print Haxe version
  352. run: haxe -version
  353. - name: Setup haxelib
  354. run: |
  355. set -ex
  356. mkdir ~/haxelib
  357. haxelib setup ~/haxelib
  358. - name: Install apt packages
  359. if: matrix.APT_PACKAGES
  360. run: |
  361. set -ex
  362. sudo apt update -qqy
  363. sudo apt install -qqy ${{matrix.APT_PACKAGES}}
  364. - name: Flash setup
  365. if: matrix.target == 'flash'
  366. run: export DISPLAY=:99.0
  367. - name: Test
  368. run: haxe RunCi.hxml
  369. working-directory: ${{github.workspace}}/tests
  370. test-docgen:
  371. needs: linux-build
  372. runs-on: ubuntu-18.04
  373. env:
  374. PLATFORM: linux64
  375. HXCPP_COMPILE_CACHE: ~/hxcache
  376. steps:
  377. - uses: actions/checkout@main
  378. with:
  379. submodules: recursive
  380. - uses: actions/download-artifact@v1
  381. with:
  382. name: linuxBinaries
  383. - name: Download xmldoc artifact
  384. uses: actions/download-artifact@v2
  385. with:
  386. name: xmldoc
  387. path: xmldoc
  388. - name: Install Neko from S3
  389. run: |
  390. set -ex
  391. curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $RUNNER_TEMP/neko_latest.tar.gz
  392. tar -xf $RUNNER_TEMP/neko_latest.tar.gz -C $RUNNER_TEMP
  393. NEKOPATH=`echo $RUNNER_TEMP/neko-*-*`
  394. sudo mkdir -p /usr/local/bin
  395. sudo mkdir -p /usr/local/lib/neko
  396. sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/
  397. sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/
  398. sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/
  399. echo "NEKOPATH=$NEKOPATH" >> $GITHUB_ENV
  400. - name: Print Neko version
  401. run: neko -version 2>&1
  402. - name: Setup Haxe
  403. run: |
  404. sudo apt install -qqy libmbedtls-dev
  405. set -ex
  406. tar -xf linuxBinaries/*_bin.tar.gz -C linuxBinaries --strip-components=1
  407. sudo mkdir -p /usr/local/bin/
  408. sudo mkdir -p /usr/local/share/haxe/
  409. sudo ln -s `pwd`/linuxBinaries/haxe /usr/local/bin/haxe
  410. sudo ln -s `pwd`/linuxBinaries/haxelib /usr/local/bin/haxelib
  411. sudo ln -s `pwd`/linuxBinaries/std /usr/local/share/haxe/std
  412. - name: Print Haxe version
  413. run: haxe -version
  414. - name: Setup haxelib
  415. run: |
  416. set -ex
  417. mkdir ~/haxelib
  418. haxelib setup ~/haxelib
  419. - name: Test documentation generation
  420. run: |
  421. set -ex
  422. haxelib git dox https://github.com/HaxeFoundation/dox.git
  423. haxelib git hxtemplo https://github.com/Simn/hxtemplo.git
  424. haxelib git hxargs https://github.com/Simn/hxargs.git
  425. haxelib git markdown https://github.com/dpeek/haxe-markdown.git
  426. haxelib git hxcpp https://github.com/HaxeFoundation/hxcpp.git
  427. cd $(haxelib libpath hxcpp)/tools/hxcpp
  428. haxe compile.hxml
  429. cd -
  430. haxe dox.hxml
  431. mkdir resources
  432. cp ../../src-json/* resources
  433. cpp/Dox -i ../../xmldoc -ex microsoft -ex javax -ex cs.internal -theme $(haxelib libpath dox)/themes/default
  434. working-directory: ${{github.workspace}}/tests/docgen
  435. linux-arm64:
  436. runs-on: ubuntu-18.04
  437. permissions:
  438. packages: write
  439. env:
  440. FORCE_COLOR: 1
  441. steps:
  442. - name: Login to GitHub Container Registry
  443. uses: docker/login-action@v1
  444. with:
  445. registry: ghcr.io
  446. username: ${{ github.actor }}
  447. password: ${{ secrets.GITHUB_TOKEN }}
  448. - name: Install Earthly
  449. 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'
  450. - name: Set up QEMU
  451. id: qemu
  452. uses: docker/setup-qemu-action@v1
  453. with:
  454. image: tonistiigi/binfmt:latest
  455. platforms: all
  456. - uses: actions/checkout@main
  457. with:
  458. submodules: recursive
  459. - name: Set CONTAINER_ vars
  460. run: |
  461. echo "CONTAINER_REG=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV;
  462. echo "CONTAINER_TAG=$(echo ${{ github.ref_name }} | sed -e 's/[^A-Za-z0-9\.]/-/g')" >> $GITHUB_ENV;
  463. - name: Build devcontainer
  464. 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"
  465. env:
  466. EARTHLY_PUSH: "${{ github.event_name == 'push' }}"
  467. EARTHLY_USE_INLINE_CACHE: true
  468. EARTHLY_SAVE_INLINE_CACHE: true
  469. - name: Set ADD_REVISION=1 for non-release
  470. if: ${{ !startsWith(github.ref, 'refs/tags/') }}
  471. run: echo "ADD_REVISION=1" >> $GITHUB_ENV
  472. - name: Build
  473. run: earthly --platform=linux/arm64 +build --ADD_REVISION="$ADD_REVISION" --SET_SAFE_DIRECTORY="true"
  474. env:
  475. EARTHLY_PUSH: "${{ github.event_name == 'push' }}"
  476. EARTHLY_REMOTE_CACHE: "ghcr.io/${{env.CONTAINER_REG}}_cache:build-${{env.CONTAINER_TAG}}-arm64"
  477. - name: Upload artifact
  478. uses: actions/[email protected]
  479. with:
  480. name: linuxArm64Binaries
  481. path: out/linux/arm64
  482. mac-build:
  483. runs-on: macos-latest
  484. env:
  485. PLATFORM: mac
  486. OPAMYES: 1
  487. MACOSX_DEPLOYMENT_TARGET: 10.13
  488. steps:
  489. - uses: actions/checkout@main
  490. with:
  491. submodules: recursive
  492. - name: Cache opam
  493. id: cache-opam
  494. uses: actions/[email protected]
  495. with:
  496. path: ~/.opam/
  497. key: ${{ runner.os }}-${{ hashFiles('./opam', './libs/') }}-1
  498. - name: Install Neko from S3
  499. run: |
  500. set -ex
  501. curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $RUNNER_TEMP/neko_latest.tar.gz
  502. tar -xf $RUNNER_TEMP/neko_latest.tar.gz -C $RUNNER_TEMP
  503. NEKOPATH=`echo $RUNNER_TEMP/neko-*-*`
  504. sudo mkdir -p /usr/local/bin
  505. sudo mkdir -p /usr/local/lib/neko
  506. sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/
  507. sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/
  508. sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/
  509. echo "NEKOPATH=$NEKOPATH" >> $GITHUB_ENV
  510. - name: Print Neko version
  511. run: neko -version 2>&1
  512. - name: Install dependencies
  513. env:
  514. # For compatibility with macOS 10.13
  515. ZLIB_VERSION: 1.2.13
  516. MBEDTLS_VERSION: 2.25.0
  517. PCRE2_VERSION: 10.42
  518. run: |
  519. set -ex
  520. brew uninstall [email protected] || echo
  521. brew uninstall [email protected] || echo
  522. brew untap local/openssl || echo
  523. brew untap local/python2 || echo
  524. brew update
  525. # brew unlink python@2
  526. brew bundle --file=tests/Brewfile --no-upgrade || brew link --overwrite awscli
  527. brew install libunistring
  528. brew install cpanminus
  529. cpanm IPC::System::Simple
  530. cpanm String::ShellQuote
  531. curl -L https://www.zlib.net/zlib-$ZLIB_VERSION.tar.gz | tar xz
  532. cd zlib-$ZLIB_VERSION
  533. ./configure
  534. make && make install
  535. cd ..
  536. curl -L https://github.com/ARMmbed/mbedtls/archive/v$MBEDTLS_VERSION.tar.gz | tar xz
  537. cd mbedtls-$MBEDTLS_VERSION
  538. make && make install
  539. cd ..
  540. curl -L https://github.com/PCRE2Project/pcre2/releases/download/pcre2-$PCRE2_VERSION/pcre2-$PCRE2_VERSION.tar.gz | tar xz
  541. cd pcre2-$PCRE2_VERSION
  542. ./configure --enable-unicode --enable-pcre2-8 --enable-pcre2-16 --enable-pcre2-32 --enable-unicode-properties --enable-pcre2grep-libz --enable-pcre2grep-libbz2 --enable-jit
  543. make && make install
  544. cd ..
  545. - name: Install OCaml libraries
  546. if: steps.cache-opam.outputs.cache-hit != 'true'
  547. run: |
  548. set -ex
  549. opam init # --disable-sandboxing
  550. opam update
  551. opam switch create 4.07.1
  552. eval $(opam env)
  553. opam env
  554. opam pin add ctypes 0.17.1 --yes
  555. opam pin add haxe . --no-action
  556. opam install haxe --deps-only --assume-depexts
  557. opam list
  558. ocamlopt -v
  559. - name: Set ADD_REVISION=1 for non-release
  560. if: ${{ !startsWith(github.ref, 'refs/tags/') }}
  561. run: echo "ADD_REVISION=1" >> $GITHUB_ENV
  562. - name: Build Haxe
  563. run: |
  564. set -ex
  565. eval $(opam env)
  566. 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
  567. opam config exec -- make -s haxelib
  568. make -s package_unix package_installer_mac
  569. ls -l out
  570. otool -L ./haxe
  571. otool -L ./haxelib
  572. - name: Upload artifact
  573. uses: actions/[email protected]
  574. with:
  575. name: macBinaries
  576. path: out
  577. windows64-test:
  578. needs: windows64-build
  579. runs-on: windows-latest
  580. env:
  581. ACTIONS_ALLOW_UNSECURE_COMMANDS: true
  582. PLATFORM: windows64
  583. TEST: ${{matrix.target}}
  584. HXCPP_COMPILE_CACHE: ~/hxcache
  585. ARCH: 64
  586. strategy:
  587. fail-fast: false
  588. matrix:
  589. # TODO enable lua after https://github.com/HaxeFoundation/haxe/issues/10919
  590. target: [macro, js, hl, cpp, 'java,jvm', cs, php, python, flash, neko]
  591. steps:
  592. - uses: actions/checkout@main
  593. with:
  594. submodules: recursive
  595. - uses: actions/download-artifact@v1
  596. with:
  597. name: win${{env.ARCH}}Binaries
  598. - name: Install Neko from S3
  599. shell: pwsh
  600. run: |
  601. Invoke-WebRequest https://build.haxe.org/builds/neko/$env:PLATFORM/neko_latest.zip -OutFile $env:RUNNER_TEMP/neko_latest.zip
  602. Expand-Archive $env:RUNNER_TEMP/neko_latest.zip -DestinationPath $env:RUNNER_TEMP
  603. $NEKOPATH = Get-ChildItem $env:RUNNER_TEMP/neko-*-*
  604. echo "$NEKOPATH" >> $env:GITHUB_PATH
  605. echo "NEKOPATH=$NEKOPATH" >> $env:GITHUB_ENV
  606. - name: Print Neko version
  607. run: neko -version 2>&1
  608. # - name: Quick test
  609. # shell: pwsh
  610. # run: |
  611. # $DOWNLOADDIR="./win$($env:ARCH)Binaries"
  612. # new-item -Name $DOWNLOADDIR -ItemType directory
  613. # Invoke-WebRequest https://build.haxe.org/builds/haxe/$env:PLATFORM/haxe_latest.zip -OutFile $DOWNLOADDIR/haxe_bin.zip
  614. - name: Setup Haxe
  615. shell: pwsh
  616. run: |
  617. $DOWNLOADDIR="./win$($env:ARCH)Binaries"
  618. Expand-Archive $DOWNLOADDIR/*_bin.zip -DestinationPath $DOWNLOADDIR
  619. Set-PSDebug -Trace 1
  620. $HAXEPATH = Get-ChildItem $DOWNLOADDIR/haxe_*_* -Directory
  621. Write-Host "::add-path::$HAXEPATH"
  622. Write-Host "::set-env name=HAXELIB_ROOT::$HAXEPATH\lib"
  623. - name: Print Haxe version
  624. shell: pwsh
  625. run: haxe -version
  626. - name: "Make Python 3 be available as python3 in the cmdline"
  627. shell: pwsh
  628. run: |
  629. Set-PSDebug -Trace 1
  630. $pypath = python -c "import sys; print(sys.executable)"
  631. $py3path = $pypath.replace("python.exe","python3.exe")
  632. cmd /c mklink $py3path $pypath
  633. python3 -V
  634. - name: Install hererocks
  635. if: matrix.target == 'lua'
  636. shell: cmd
  637. run: |
  638. pip install hererocks
  639. hererocks lua53 -l5.3 -rlatest
  640. call lua53/bin/activate
  641. - name: Install wget
  642. if: matrix.target == 'flash'
  643. shell: cmd
  644. run: |
  645. choco install wget
  646. wget --version
  647. - name: Setup haxelib
  648. shell: pwsh
  649. run: |
  650. mkdir "$env:HAXELIB_ROOT"
  651. haxelib setup "$env:HAXELIB_ROOT"
  652. - name: Test
  653. shell: pwsh
  654. run: haxe RunCi.hxml
  655. working-directory: ${{github.workspace}}/tests
  656. windows-test:
  657. needs: windows-build
  658. runs-on: windows-latest
  659. env:
  660. ACTIONS_ALLOW_UNSECURE_COMMANDS: true
  661. PLATFORM: windows
  662. TEST: ${{matrix.target}}
  663. HXCPP_COMPILE_CACHE: ~/hxcache
  664. ARCH: 32
  665. strategy:
  666. fail-fast: false
  667. matrix:
  668. # TODO jvm: https://github.com/HaxeFoundation/haxe/issues/8601
  669. # TODO enable lua after https://github.com/HaxeFoundation/haxe/issues/10919
  670. target: [macro, js, hl, cpp, java, cs, php, python, flash, neko]
  671. steps:
  672. - uses: actions/checkout@main
  673. with:
  674. submodules: recursive
  675. - uses: actions/download-artifact@v1
  676. with:
  677. name: win${{env.ARCH}}Binaries
  678. - name: Install Neko from S3
  679. shell: pwsh
  680. run: |
  681. Invoke-WebRequest https://build.haxe.org/builds/neko/$env:PLATFORM/neko_latest.zip -OutFile $env:RUNNER_TEMP/neko_latest.zip
  682. Expand-Archive $env:RUNNER_TEMP/neko_latest.zip -DestinationPath $env:RUNNER_TEMP
  683. $NEKOPATH = Get-ChildItem $env:RUNNER_TEMP/neko-*-*
  684. echo "$NEKOPATH" >> $env:GITHUB_PATH
  685. echo "NEKOPATH=$NEKOPATH" >> $env:GITHUB_ENV
  686. - name: Print Neko version
  687. run: neko -version 2>&1
  688. # - name: Quick test
  689. # shell: pwsh
  690. # run: |
  691. # $DOWNLOADDIR="./win$($env:ARCH)Binaries"
  692. # new-item -Name $DOWNLOADDIR -ItemType directory
  693. # Invoke-WebRequest https://build.haxe.org/builds/haxe/$env:PLATFORM/haxe_latest.zip -OutFile $DOWNLOADDIR/haxe_bin.zip
  694. - name: Setup Haxe
  695. shell: pwsh
  696. run: |
  697. $DOWNLOADDIR="./win$($env:ARCH)Binaries"
  698. Expand-Archive $DOWNLOADDIR/*_bin.zip -DestinationPath $DOWNLOADDIR
  699. Set-PSDebug -Trace 1
  700. $HAXEPATH = Get-ChildItem $DOWNLOADDIR/haxe_*_* -Directory
  701. Write-Host "::add-path::$HAXEPATH"
  702. Write-Host "::set-env name=HAXELIB_ROOT::$HAXEPATH\lib"
  703. - name: Print Haxe version
  704. shell: pwsh
  705. run: haxe -version
  706. - name: "Make Python 3 be available as python3 in the cmdline"
  707. shell: pwsh
  708. run: |
  709. Set-PSDebug -Trace 1
  710. $pypath = python -c "import sys; print(sys.executable)"
  711. $py3path = $pypath.replace("python.exe","python3.exe")
  712. cmd /c mklink $py3path $pypath
  713. python3 -V
  714. - name: Install hererocks
  715. if: matrix.target == 'lua'
  716. shell: cmd
  717. run: |
  718. pip install hererocks
  719. hererocks lua53 -l5.3 -rlatest
  720. call lua53/bin/activate
  721. - name: Install wget
  722. if: matrix.target == 'flash'
  723. shell: cmd
  724. run: |
  725. choco install wget
  726. wget --version
  727. - name: Setup haxelib
  728. shell: pwsh
  729. run: |
  730. mkdir "$env:HAXELIB_ROOT"
  731. haxelib setup "$env:HAXELIB_ROOT"
  732. - name: Test
  733. shell: pwsh
  734. run: haxe RunCi.hxml
  735. working-directory: ${{github.workspace}}/tests
  736. mac-test:
  737. needs: mac-build
  738. runs-on: macos-latest
  739. env:
  740. PLATFORM: mac
  741. TEST: ${{matrix.target}}
  742. HXCPP_COMPILE_CACHE: ~/hxcache
  743. HAXE_STD_PATH: /usr/local/share/haxe/std
  744. strategy:
  745. fail-fast: false
  746. matrix:
  747. target: [macro, js, hl, cpp, 'java,jvm', cs, php, python, flash, neko]
  748. include:
  749. - target: hl
  750. BREW_PACKAGES: ninja
  751. steps:
  752. - uses: actions/checkout@main
  753. with:
  754. submodules: recursive
  755. - uses: actions/download-artifact@v1
  756. with:
  757. name: macBinaries
  758. - name: Install Neko from S3
  759. run: |
  760. set -ex
  761. curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $RUNNER_TEMP/neko_latest.tar.gz
  762. tar -xf $RUNNER_TEMP/neko_latest.tar.gz -C $RUNNER_TEMP
  763. NEKOPATH=`echo $RUNNER_TEMP/neko-*-*`
  764. sudo mkdir -p /usr/local/bin
  765. sudo mkdir -p /usr/local/lib/neko
  766. sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/
  767. sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/
  768. sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/
  769. echo "NEKOPATH=$NEKOPATH" >> $GITHUB_ENV
  770. - name: Print Neko version
  771. run: neko -version 2>&1
  772. - name: Setup Haxe
  773. run: |
  774. # mkdir ./macBinaries
  775. # curl -sSL https://build.haxe.org/builds/haxe/mac/haxe_latest.tar.gz -o ./macBinaries/haxe_bin.tar.gz
  776. set -ex
  777. tar -xf macBinaries/*_bin.tar.gz -C macBinaries --strip-components=1
  778. sudo mkdir -p /usr/local/bin/
  779. sudo mkdir -p /usr/local/share/haxe/
  780. sudo ln -s `pwd`/macBinaries/haxe /usr/local/bin/haxe
  781. sudo ln -s `pwd`/macBinaries/haxelib /usr/local/bin/haxelib
  782. sudo ln -s `pwd`/macBinaries/std /usr/local/share/haxe/std
  783. - name: Print Haxe version
  784. run: haxe -version
  785. - name: Setup haxelib
  786. run: |
  787. set -ex
  788. mkdir ~/haxelib
  789. haxelib setup ~/haxelib
  790. - name: Install homebrew packages
  791. if: matrix.BREW_PACKAGES
  792. run: brew install ${{matrix.BREW_PACKAGES}}
  793. - name: Test
  794. run: |
  795. # disable invalid Unicode filenames on APFS
  796. echo "" > sys/compile-fs.hxml
  797. haxe RunCi.hxml
  798. working-directory: ${{github.workspace}}/tests
  799. deploy:
  800. if: success() && github.repository_owner == 'HaxeFoundation' && github.event_name != 'pull_request'
  801. needs: [linux-test, linux-arm64, mac-test, windows-test, windows64-test]
  802. runs-on: ubuntu-18.04
  803. steps:
  804. # this is only needed for to get `COMMIT_DATE`...
  805. # maybe https://github.community/t/expose-commit-timestamp-in-the-github-context-data/16460/3
  806. # would be faster
  807. - name: Checkout the repository
  808. uses: actions/checkout@main
  809. - name: Download build artifacts
  810. uses: actions/download-artifact@v2
  811. - name: Install awscli
  812. run: |
  813. set -ex
  814. sudo apt-get update -qqy
  815. sudo apt-get install -qqy awscli
  816. # https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
  817. - name: Extract branch name
  818. id: extract_branch
  819. shell: bash
  820. run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
  821. - name: Upload binaries
  822. shell: bash
  823. env:
  824. AWS_ACCESS_KEY_ID: ${{ secrets.HXBUILDS_AWS_ACCESS_KEY_ID }}
  825. AWS_SECRET_ACCESS_KEY: ${{ secrets.HXBUILDS_AWS_SECRET_ACCESS_KEY }}
  826. HXBUILDS_S3ADDR: ${{ secrets.HXBUILDS_S3ADDR }}
  827. AWS_EC2_METADATA_DISABLED: true
  828. run: |
  829. set -ex
  830. COMMIT_HASH_SHORT=${GITHUB_SHA:0:7}
  831. COMMIT_DATE=`TZ=UTC git show --quiet --date='format-local:%Y-%m-%d' --format="%cd"`
  832. FILE_NAME=haxe_${COMMIT_DATE}_${{ steps.extract_branch.outputs.branch }}_${COMMIT_HASH_SHORT}
  833. aws s3 cp linuxBinaries/*_bin.tar.gz ${HXBUILDS_S3ADDR}/haxe/linux64/${FILE_NAME}.tar.gz
  834. aws s3 cp linuxArm64Binaries/*_bin.tar.gz ${HXBUILDS_S3ADDR}/haxe/linux-arm64/${FILE_NAME}.tar.gz
  835. aws s3 cp macBinaries/*_bin.tar.gz ${HXBUILDS_S3ADDR}/haxe/mac/${FILE_NAME}.tar.gz
  836. aws s3 cp macBinaries/*_installer.tar.gz ${HXBUILDS_S3ADDR}/haxe/mac-installer/${FILE_NAME}.tar.gz
  837. aws s3 cp win64Binaries/*_bin.zip ${HXBUILDS_S3ADDR}/haxe/windows64/${FILE_NAME}.zip
  838. aws s3 cp win64Binaries/*_installer.zip ${HXBUILDS_S3ADDR}/haxe/windows64-installer/${FILE_NAME}.zip
  839. aws s3 cp win64Binaries/*.nupkg ${HXBUILDS_S3ADDR}/haxe/windows64-choco/
  840. aws s3 cp win32Binaries/*_bin.zip ${HXBUILDS_S3ADDR}/haxe/windows/${FILE_NAME}.zip
  841. aws s3 cp win32Binaries/*_installer.zip ${HXBUILDS_S3ADDR}/haxe/windows-installer/${FILE_NAME}.zip
  842. aws s3 cp win32Binaries/*.nupkg ${HXBUILDS_S3ADDR}/haxe/windows-choco/
  843. - name: Update "latest"
  844. if: github.ref == 'refs/heads/development'
  845. shell: bash
  846. env:
  847. AWS_ACCESS_KEY_ID: ${{ secrets.HXBUILDS_AWS_ACCESS_KEY_ID }}
  848. AWS_SECRET_ACCESS_KEY: ${{ secrets.HXBUILDS_AWS_SECRET_ACCESS_KEY }}
  849. HXBUILDS_S3ADDR: ${{ secrets.HXBUILDS_S3ADDR }}
  850. AWS_EC2_METADATA_DISABLED: true
  851. run: |
  852. set -ex
  853. aws s3 cp linuxBinaries/*_bin.tar.gz ${HXBUILDS_S3ADDR}/haxe/linux64/haxe_latest.tar.gz
  854. aws s3 cp linuxArm64Binaries/*_bin.tar.gz ${HXBUILDS_S3ADDR}/haxe/linux-arm64/haxe_latest.tar.gz
  855. aws s3 cp macBinaries/*_bin.tar.gz ${HXBUILDS_S3ADDR}/haxe/mac/haxe_latest.tar.gz
  856. aws s3 cp macBinaries/*_installer.tar.gz ${HXBUILDS_S3ADDR}/haxe/mac-installer/haxe_latest.tar.gz
  857. aws s3 cp win64Binaries/*_bin.zip ${HXBUILDS_S3ADDR}/haxe/windows64/haxe_latest.zip
  858. aws s3 cp win64Binaries/*_installer.zip ${HXBUILDS_S3ADDR}/haxe/windows64-installer/haxe_latest.zip
  859. aws s3 cp win32Binaries/*_bin.zip ${HXBUILDS_S3ADDR}/haxe/windows/haxe_latest.zip
  860. aws s3 cp win32Binaries/*_installer.zip ${HXBUILDS_S3ADDR}/haxe/windows-installer/haxe_latest.zip
  861. # Chocolatey packages have to be named with version number,
  862. # so let's use web redirection to keep the original file name.
  863. [[ "$HXBUILDS_S3ADDR" =~ s3://([^/]+)(.*) ]] && HXBUILDS_S3BUCKET="${BASH_REMATCH[1]}" && HXBUILDS_S3PATH="${BASH_REMATCH[2]}"
  864. [[ `echo win64Binaries/*.nupkg` =~ win64Binaries/(.+) ]] && FILE_NAME="${BASH_REMATCH[1]}"
  865. 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}"
  866. [[ `echo win32Binaries/*.nupkg` =~ win32Binaries/(.+) ]] && FILE_NAME="${BASH_REMATCH[1]}"
  867. 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}"
  868. deploy_apidoc:
  869. if: success() && github.repository_owner == 'HaxeFoundation' && github.event_name != 'pull_request'
  870. needs: [linux-test, linux-arm64, mac-test, windows-test, windows64-test]
  871. runs-on: ubuntu-18.04
  872. steps:
  873. - name: Install dependencies
  874. run: |
  875. set -ex
  876. sudo apt-get install -qqy libc6
  877. - name: Download Haxe
  878. uses: actions/download-artifact@v2
  879. with:
  880. name: linuxBinaries
  881. path: linuxBinaries
  882. - name: Setup Haxe
  883. run: |
  884. set -ex
  885. tar -xf linuxBinaries/*_bin.tar.gz -C linuxBinaries --strip-components=1
  886. sudo mkdir -p /usr/local/bin/
  887. sudo mkdir -p /usr/local/share/haxe/
  888. sudo ln -s `pwd`/linuxBinaries/haxe /usr/local/bin/haxe
  889. sudo ln -s `pwd`/linuxBinaries/haxelib /usr/local/bin/haxelib
  890. sudo ln -s `pwd`/linuxBinaries/std /usr/local/share/haxe/std
  891. - name: Download xmldoc artifact
  892. uses: actions/download-artifact@v2
  893. with:
  894. name: xmldoc
  895. path: xmldoc
  896. - name: Deploy to api.haxe.org
  897. env:
  898. GHP_EMAIL: [email protected]
  899. GHP_USERNAME: Haxe CI Bot
  900. GHP_REMOTE: ${{ secrets.GHP_REMOTE }}
  901. run: |
  902. set -ex
  903. LOCAL="`pwd`/extra/api.haxe.org"
  904. git clone "${GHP_REMOTE}" "${LOCAL}"
  905. haxe --cwd "${LOCAL}" --run ImportXml "`pwd`/xmldoc"