build_iwasm_release.yml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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: working directory
  14. type: string
  15. required: true
  16. llvm_cache_key:
  17. description: the cache key of llvm libraries
  18. type: string
  19. required: true
  20. runner:
  21. description: OS of compilation
  22. type: string
  23. required: true
  24. upload_url:
  25. description: a semantic version number. it is required when `release` is true.
  26. type: string
  27. required: false
  28. ver_num:
  29. description: a semantic version number. it is required when `release` is true.
  30. type: string
  31. required: false
  32. jobs:
  33. build:
  34. runs-on: ${{ inputs.runner }}
  35. steps:
  36. - uses: actions/checkout@v4
  37. - name: get cached LLVM libraries
  38. id: retrieve_llvm_libs
  39. uses: actions/cache@v4
  40. with:
  41. path: |
  42. ./core/deps/llvm/build/bin
  43. ./core/deps/llvm/build/include
  44. ./core/deps/llvm/build/lib
  45. ./core/deps/llvm/build/libexec
  46. ./core/deps/llvm/build/share
  47. key: ${{ inputs.llvm_cache_key }}
  48. fail-on-cache-miss: true
  49. - name: generate iwasm binary release
  50. run: |
  51. cmake -S . -B build \
  52. -DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_FAST_JIT=1 -DWAMR_BUILD_JIT=1 \
  53. -DWAMR_BUILD_CUSTOM_NAME_SECTION=0 \
  54. -DWAMR_BUILD_DEBUG_INTERP=0 \
  55. -DWAMR_BUILD_DEBUG_AOT=0 \
  56. -DWAMR_BUILD_DUMP_CALL_STACK=0 \
  57. -DWAMR_BUILD_LIBC_UVWASI=0 \
  58. -DWAMR_BUILD_LIBC_EMCC=0 \
  59. -DWAMR_BUILD_LIB_RATS=0 \
  60. -DWAMR_BUILD_LOAD_CUSTOM_SECTION=0 \
  61. -DWAMR_BUILD_MEMORY_PROFILING=0 \
  62. -DWAMR_BUILD_MINI_LOADER=0 \
  63. -DWAMR_BUILD_MULTI_MODULE=0 \
  64. -DWAMR_BUILD_PERF_PROFILING=0 \
  65. -DWAMR_BUILD_SPEC_TEST=0 \
  66. -DWAMR_BUILD_BULK_MEMORY=1 \
  67. -DWAMR_BUILD_LIB_PTHREAD=1 \
  68. -DWAMR_BUILD_LIB_PTHREAD_SEMAPHORE=1 \
  69. -DWAMR_BUILD_LIB_WASI_THREADS=1 \
  70. -DWAMR_BUILD_LIBC_BUILTIN=1 \
  71. -DWAMR_BUILD_LIBC_WASI=1 \
  72. -DWAMR_BUILD_REF_TYPES=1 \
  73. -DWAMR_BUILD_SIMD=1 \
  74. -DWAMR_BUILD_SHARED_MEMORY=1 \
  75. -DWAMR_BUILD_TAIL_CALL=1 \
  76. -DWAMR_BUILD_THREAD_MGR=1
  77. cmake --build build --config Release --parallel 4
  78. working-directory: ${{ inputs.cwd }}
  79. - name: compress the binary
  80. run: |
  81. tar czf iwasm-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz iwasm
  82. zip iwasm-${{ inputs.ver_num }}-${{ inputs.runner }}.zip iwasm
  83. working-directory: ${{ inputs.cwd }}/build
  84. - name: upload release tar.gz
  85. uses: actions/upload-release-asset@v1
  86. env:
  87. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  88. with:
  89. upload_url: ${{ inputs.upload_url }}
  90. asset_path: ${{ inputs.cwd }}/build/iwasm-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz
  91. asset_name: iwasm-${{ inputs.ver_num }}-${{ inputs.arch }}-${{ inputs.runner }}.tar.gz
  92. asset_content_type: application/x-gzip
  93. - name: upload release zip
  94. uses: actions/upload-release-asset@v1
  95. env:
  96. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  97. with:
  98. upload_url: ${{ inputs.upload_url }}
  99. asset_path: ${{ inputs.cwd }}/build/iwasm-${{ inputs.ver_num }}-${{ inputs.runner }}.zip
  100. asset_name: iwasm-${{ inputs.ver_num }}-${{ inputs.arch }}-${{ inputs.runner }}.zip
  101. asset_content_type: application/zip