|
| 1 | +name: Setup directories etc. |
| 2 | +description: >- |
| 3 | + Build baseruby for cross-compiling |
| 4 | +
|
| 5 | +inputs: |
| 6 | + srcdir: |
| 7 | + required: true |
| 8 | + default: ${{ github.workspace }} |
| 9 | + description: >- |
| 10 | + Directory of source codes. |
| 11 | +
|
| 12 | + builddir: |
| 13 | + required: false |
| 14 | + default: ${{ github.workspace }}/baseruby |
| 15 | + description: >- |
| 16 | + Where baseruby will be built. |
| 17 | +
|
| 18 | + installdir: |
| 19 | + required: false |
| 20 | + default: install |
| 21 | + description: >- |
| 22 | + The path where the baseruby will be installed to. |
| 23 | + This is relative from the workspace. |
| 24 | +
|
| 25 | +outputs: |
| 26 | + ruby: |
| 27 | + value: ${{ steps.build.outputs.installdir }}/bin/ruby |
| 28 | + description: >- |
| 29 | + The path of the executable baseruby. |
| 30 | + dump_ast: |
| 31 | + value: ${{ steps.build.outputs.installdir }}/bin/dump_ast |
| 32 | + description: >- |
| 33 | + The path of the executable dump_ast. |
| 34 | +
|
| 35 | +runs: |
| 36 | + using: composite |
| 37 | + |
| 38 | + steps: |
| 39 | + - name: Build baseruby |
| 40 | + shell: bash |
| 41 | + id: build |
| 42 | + run: | |
| 43 | + case "$installdir" in /*) ;; *) installdir="$PWD/$installdir";; esac |
| 44 | + mkdir "$builddir" |
| 45 | + ln -sr "$srcdir" "$builddir/.src" |
| 46 | + pushd "$builddir" |
| 47 | + .src/configure "--prefix=${installdir}" --disable-install-doc |
| 48 | + CONFIGURE_ARGS=--with-out-ext=-test- make install |
| 49 | + install dump_ast "${installdir}/bin" |
| 50 | + { |
| 51 | + echo "${installdir}/bin/dump_ast" |
| 52 | + echo "${installdir}/.installed.list" |
| 53 | + echo "${installdir}/" |
| 54 | + } >> .installed.list |
| 55 | + cp .installed.list "${installdir}/" |
| 56 | + make distclean |
| 57 | + rm .src |
| 58 | + popd |
| 59 | + rmdir "$builddir" |
| 60 | + { |
| 61 | + echo "installdir=${installdir}" |
| 62 | + } | tee -a "$GITHUB_OUTPUT" |
| 63 | + env: |
| 64 | + srcdir: ${{ inputs.srcdir }} |
| 65 | + builddir: ${{ inputs.builddir }} |
| 66 | + installdir: ${{ inputs.installdir }} |
| 67 | + |
| 68 | + - name: clean |
| 69 | + uses: gacts/run-and-post-run@598d7a875d5620e0457490555b5e18e46082aa47 # v1.4.4 |
| 70 | + with: |
| 71 | + working-directory: ${{ inputs.srcdir }} |
| 72 | + post: | |
| 73 | + ruby tool/rbuninstall.rb "${{ steps.build.outputs.installdir }}/.installed.list" > /dev/null |
0 commit comments