build-linux.yml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. - name: Install dependencies
  2. run: |
  3. set -ex
  4. sudo add-apt-repository ppa:avsm/ppa -y # provides OPAM 2
  5. sudo add-apt-repository ppa:haxe/ocaml -y # provides newer version of mbedtls
  6. sudo apt-get update -qqy
  7. sudo apt-get install -qqy ocaml-nox camlp5 opam libpcre3-dev zlib1g-dev libgtk2.0-dev libmbedtls-dev ninja-build libstring-shellquote-perl
  8. - name: Install OCaml libraries
  9. run: |
  10. set -ex
  11. opam init # --disable-sandboxing
  12. opam update
  13. opam pin add haxe . --no-action
  14. opam install haxe --deps-only --assume-depexts
  15. opam list
  16. ocamlopt -v
  17. - name: Set ADD_REVISION=1 for non-release
  18. if: ${{ !startsWith(github.ref, 'refs/tags/') }}
  19. run: echo "ADD_REVISION=1" >> $GITHUB_ENV
  20. - name: Build Haxe
  21. run: |
  22. set -ex
  23. eval $(opam env)
  24. opam config exec -- make -s -j`nproc` STATICLINK=1 haxe
  25. opam config exec -- make -s haxelib
  26. make -s package_unix
  27. ls -l out
  28. ldd -v ./haxe
  29. ldd -v ./haxelib
  30. # https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
  31. - name: Extract branch name
  32. id: extract_branch
  33. shell: bash
  34. run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
  35. - name: Build xmldoc
  36. run: |
  37. set -ex
  38. make -s xmldoc
  39. cat >extra/doc/info.json <<EOL
  40. {
  41. "commit": "$GITHUB_SHA",
  42. "branch": "${{ steps.extract_branch.outputs.branch }}"
  43. }
  44. EOL
  45. - name: Upload xmldoc artifact
  46. uses: actions/[email protected]
  47. with:
  48. name: xmldoc
  49. path: extra/doc
  50. - name: Upload artifact
  51. uses: actions/[email protected]
  52. with:
  53. name: linuxBinaries
  54. path: out