Add CIs to release new version and publish binary files (#1648)
Add CIs to enable the release process of a new version of WAMR, and build and publish the binary files when a version is released, including iwasm, wamrc, lldb, vscode-extension and wamr-ide for Ubuntu-20.04, Ubuntu-22.04 and MacOS. And refine the CIs to test spec cases.
This commit is contained in:
90
.github/workflows/build_wamrc.yml
vendored
Normal file
90
.github/workflows/build_wamrc.yml
vendored
Normal file
@ -0,0 +1,90 @@
|
||||
# Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
name: build wamrc
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
arch:
|
||||
description: arch of the release
|
||||
type: string
|
||||
required: false
|
||||
default: x86_64
|
||||
llvm_cache_key:
|
||||
description: the cache key of llvm libraries
|
||||
type: string
|
||||
required: true
|
||||
release:
|
||||
description: it is a part of the release process
|
||||
type: boolean
|
||||
required: true
|
||||
runner:
|
||||
description: OS of compilation
|
||||
type: string
|
||||
required: true
|
||||
upload_url:
|
||||
description: a semantic version number. it is required when `release` is true.
|
||||
type: string
|
||||
required: false
|
||||
ver_num:
|
||||
description: a semantic version number. it is required when `release` is true.
|
||||
type: string
|
||||
required: false
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ${{ inputs.runner }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: get cached LLVM libraries
|
||||
id: cache_llvm
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
./core/deps/llvm/build/bin
|
||||
./core/deps/llvm/build/include
|
||||
./core/deps/llvm/build/lib
|
||||
./core/deps/llvm/build/libexec
|
||||
./core/deps/llvm/build/share
|
||||
key: ${{ inputs.llvm_cache_key }}
|
||||
|
||||
- name: Build llvm and clang from source
|
||||
if: steps.cache_llvm.outputs.cache-hit != 'true'
|
||||
run: /usr/bin/env python3 ./build_llvm.py --arch X86
|
||||
working-directory: build-scripts
|
||||
|
||||
- name: generate wamrc binary release
|
||||
run: |
|
||||
cmake -S . -B build
|
||||
cmake --build build --config Release --parallel 4
|
||||
working-directory: wamr-compiler
|
||||
|
||||
- name: compress the binary
|
||||
if: inputs.release
|
||||
run: |
|
||||
tar czf wamrc-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz wamrc
|
||||
zip wamrc-${{ inputs.ver_num }}-${{ inputs.runner }}.zip wamrc
|
||||
working-directory: wamr-compiler/build
|
||||
|
||||
- name: upload release tar.gz
|
||||
if: inputs.release
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ inputs.upload_url }}
|
||||
asset_path: wamr-compiler/build/wamrc-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz
|
||||
asset_name: wamrc-${{ inputs.ver_num }}-${{ inputs.arch }}-${{ inputs.runner }}.tar.gz
|
||||
asset_content_type: application/x-gzip
|
||||
|
||||
- name: upload release zip
|
||||
if: inputs.release
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ inputs.upload_url }}
|
||||
asset_path: wamr-compiler/build/wamrc-${{ inputs.ver_num }}-${{ inputs.runner }}.zip
|
||||
asset_name: wamrc-${{ inputs.ver_num }}-${{ inputs.arch }}-${{ inputs.runner }}.zip
|
||||
asset_content_type: application/zip
|
||||
Reference in New Issue
Block a user