build_iwasm_release.yml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. # Copyright (C) 2019 Intel Corporation. All rights reserved.
  2. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  3. name: build iwasm release
  4. on:
  5. workflow_call:
  6. inputs:
  7. arch:
  8. description: arch of the release
  9. type: string
  10. required: false
  11. default: x86_64
  12. cwd:
  13. description: workfing directory
  14. type: string
  15. required: true
  16. runner:
  17. description: OS of compilation
  18. type: string
  19. required: true
  20. upload_url:
  21. description: a semantic version number. it is required when `release` is true.
  22. type: string
  23. required: false
  24. ver_num:
  25. description: a semantic version number. it is required when `release` is true.
  26. type: string
  27. required: false
  28. jobs:
  29. build:
  30. runs-on: ${{ inputs.runner }}
  31. steps:
  32. - uses: actions/checkout@v3
  33. - name: generate iwasm binary release
  34. run: |
  35. cmake -S . -B build \
  36. -DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_JIT=0 \
  37. -DWAMR_BUILD_CUSTOM_NAME_SECTION=0 \
  38. -DWAMR_BUILD_DEBUG_INTERP=0 \
  39. -DWAMR_BUILD_DEBUG_AOT=0 \
  40. -DWAMR_BUILD_DUMP_CALL_STACK=0 \
  41. -DWAMR_BUILD_LIBC_UVWASI=0 \
  42. -DWAMR_BUILD_LIBC_EMCC=0 \
  43. -DWAMR_BUILD_LIB_RATS=0 \
  44. -DWAMR_BUILD_LOAD_CUSTOM_SECTION=0 \
  45. -DWAMR_BUILD_MEMORY_PROFILING=0 \
  46. -DWAMR_BUILD_MINI_LOADER=0 \
  47. -DWAMR_BUILD_MULTI_MODULE=0 \
  48. -DWAMR_BUILD_PERF_PROFILING=0 \
  49. -DWAMR_BUILD_SPEC_TEST=0 \
  50. -DWAMR_BUILD_BULK_MEMORY=1 \
  51. -DWAMR_BUILD_LIB_PTHREAD=1 \
  52. -DWAMR_BUILD_LIB_PTHREAD_SEMAPHORE=1 \
  53. -DWAMR_BUILD_LIBC_BUILTIN=1 \
  54. -DWAMR_BUILD_LIBC_WASI=1 \
  55. -DWAMR_BUILD_REF_TYPES=1 \
  56. -DWAMR_BUILD_SIMD=1 \
  57. -DWAMR_BUILD_SHARED_MEMORY=1 \
  58. -DWAMR_BUILD_TAIL_CALL=1 \
  59. -DWAMR_BUILD_THREAD_MGR=1
  60. cmake --build build --config Release --parallel 4
  61. working-directory: ${{ inputs.cwd }}
  62. - name: compress the binary
  63. run: |
  64. tar czf iwasm-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz iwasm
  65. zip iwasm-${{ inputs.ver_num }}-${{ inputs.runner }}.zip iwasm
  66. working-directory: ${{ inputs.cwd }}/build
  67. - name: upload release tar.gz
  68. uses: actions/upload-release-asset@v1
  69. env:
  70. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  71. with:
  72. upload_url: ${{ inputs.upload_url }}
  73. asset_path: ${{ inputs.cwd }}/build/iwasm-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz
  74. asset_name: iwasm-${{ inputs.ver_num }}-${{ inputs.arch }}-${{ inputs.runner }}.tar.gz
  75. asset_content_type: application/x-gzip
  76. - name: upload release zip
  77. uses: actions/upload-release-asset@v1
  78. env:
  79. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  80. with:
  81. upload_url: ${{ inputs.upload_url }}
  82. asset_path: ${{ inputs.cwd }}/build/iwasm-${{ inputs.ver_num }}-${{ inputs.runner }}.zip
  83. asset_name: iwasm-${{ inputs.ver_num }}-${{ inputs.arch }}-${{ inputs.runner }}.zip
  84. asset_content_type: application/zip