Skip to content

Commit d0fb271

Browse files
authored
Fix several issues in CI binary releasing (#2064)
1 parent 0f73ce1 commit d0fb271

File tree

12 files changed

+79
-23
lines changed

12 files changed

+79
-23
lines changed

.github/workflows/build_iwasm_release.yml

+20
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ on:
1414
description: workfing directory
1515
type: string
1616
required: true
17+
llvm_cache_key:
18+
description: the cache key of llvm libraries
19+
type: string
20+
required: true
1721
runner:
1822
description: OS of compilation
1923
type: string
@@ -33,6 +37,22 @@ jobs:
3337
steps:
3438
- uses: actions/checkout@v3
3539

40+
- name: get cached LLVM libraries
41+
id: retrieve_llvm_libs
42+
uses: actions/cache@v3
43+
with:
44+
path: |
45+
./core/deps/llvm/build/bin
46+
./core/deps/llvm/build/include
47+
./core/deps/llvm/build/lib
48+
./core/deps/llvm/build/libexec
49+
./core/deps/llvm/build/share
50+
key: ${{ inputs.llvm_cache_key }}
51+
52+
- name: Quit if cache miss
53+
if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true'
54+
run: echo "::error::can not get prebuilt llvm libraries" && exit 1
55+
3656
- name: generate iwasm binary release
3757
run: |
3858
cmake -S . -B build \

.github/workflows/build_wamr_vscode_ext.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,25 @@ jobs:
2424
uses: actions/setup-node@v3
2525
with:
2626
node-version: 14.x
27-
28-
- name: set vscode extension to correct version
27+
28+
- name: set vscode extension to correct version
2929
run: |
3030
npm install -g json
3131
json -I -f package.json -e "this.version=\"${{ inputs.ver_num }}\""
3232
working-directory: test-tools/wamr-ide/VSCode-Extension
3333

34+
# [!workflow]
35+
# bypass the step of publishing the extension to the Market.
36+
# recover it after creating the secret in the Environment
3437
- name: generate wamr ide vscode extension
35-
env:
38+
env:
3639
credentials: ${{ secrets.TOKEN }}
3740
run: |
3841
npm install -g vsce
3942
rm -rf node_modules
4043
npm install
4144
vsce package
42-
vsce publish -p ${{ secrets.TOKEN }}
45+
# vsce publish -p ${{ secrets.TOKEN }}
4346
working-directory: test-tools/wamr-ide/VSCode-Extension
4447

4548
- name: compress the vscode extension

.github/workflows/build_wamrc.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- uses: actions/checkout@v3
3939

4040
- name: get cached LLVM libraries
41-
id: cache_llvm
41+
id: retrieve_llvm_libs
4242
uses: actions/cache@v3
4343
with:
4444
path: |
@@ -49,10 +49,9 @@ jobs:
4949
./core/deps/llvm/build/share
5050
key: ${{ inputs.llvm_cache_key }}
5151

52-
- name: Build llvm and clang from source
53-
if: steps.cache_llvm.outputs.cache-hit != 'true'
54-
run: /usr/bin/env python3 ./build_llvm.py --arch X86
55-
working-directory: build-scripts
52+
- name: Quit if cache miss
53+
if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true'
54+
run: echo "::error::can not get prebuilt llvm libraries" && exit 1
5655

5756
- name: generate wamrc binary release
5857
run: |

.github/workflows/release_process.yml

+35-12
Original file line numberDiff line numberDiff line change
@@ -49,36 +49,56 @@ jobs:
4949
draft: false
5050
body: ${{ env.RELEASE_NOTE }}
5151

52+
#
53+
# LLVM_LIBRARIES
54+
build_llvm_libraries_on_ubuntu_2004:
55+
needs: [create_tag, create_release]
56+
uses: ./.github/workflows/build_llvm_libraries.yml
57+
with:
58+
os: "ubuntu-20.04"
59+
arch: "X86"
60+
61+
build_llvm_libraries_on_ubuntu_2204:
62+
needs: [create_tag, create_release]
63+
uses: ./.github/workflows/build_llvm_libraries.yml
64+
with:
65+
os: "ubuntu-22.04"
66+
arch: "X86"
67+
68+
build_llvm_libraries_on_macos:
69+
needs: [create_tag, create_release]
70+
uses: ./.github/workflows/build_llvm_libraries.yml
71+
with:
72+
os: "macos-latest"
73+
arch: "X86"
74+
5275
#
5376
# WAMRC
5477
release_wamrc_on_ubuntu_2004:
55-
needs: [create_tag, create_release]
78+
needs: [create_tag, create_release, build_llvm_libraries_on_ubuntu_2004]
5679
uses: ./.github/workflows/build_wamrc.yml
5780
with:
58-
# can't take an env variable here
59-
llvm_cache_key: ubuntu-20.04-build-llvm_libraries_ex
81+
llvm_cache_key: ${{ needs.build_llvm_libraries_on_ubuntu_2004.outputs.cache_key }}
6082
release: true
6183
runner: ubuntu-20.04
6284
upload_url: ${{ needs.create_release.outputs.upload_url }}
6385
ver_num: ${{ needs.create_tag.outputs.new_ver}}
6486

6587
release_wamrc_on_ubuntu_2204:
66-
needs: [create_tag, create_release]
88+
needs: [create_tag, create_release, build_llvm_libraries_on_ubuntu_2204 ]
6789
uses: ./.github/workflows/build_wamrc.yml
6890
with:
69-
# can't take an env variable here
70-
llvm_cache_key: ubuntu-22.04-build-llvm_libraries_ex
91+
llvm_cache_key: ${{ needs.build_llvm_libraries_on_ubuntu_2204.outputs.cache_key }}
7192
release: true
7293
runner: ubuntu-22.04
7394
upload_url: ${{ needs.create_release.outputs.upload_url }}
7495
ver_num: ${{ needs.create_tag.outputs.new_ver }}
7596

7697
release_wamrc_on_ubuntu_macos:
77-
needs: [create_tag, create_release]
98+
needs: [create_tag, create_release, build_llvm_libraries_on_macos]
7899
uses: ./.github/workflows/build_wamrc.yml
79100
with:
80-
# can't take an env variable here
81-
llvm_cache_key: macos-latest-build-llvm_libraries_ex
101+
llvm_cache_key: ${{ needs.build_llvm_libraries_on_macos.outputs.cache_key }}
82102
release: true
83103
runner: macos-latest
84104
upload_url: ${{ needs.create_release.outputs.upload_url }}
@@ -87,28 +107,31 @@ jobs:
87107
#
88108
# IWASM
89109
release_iwasm_on_ubuntu_2004:
90-
needs: [create_tag, create_release]
110+
needs: [create_tag, create_release, build_llvm_libraries_on_ubuntu_2004]
91111
uses: ./.github/workflows/build_iwasm_release.yml
92112
with:
93113
cwd: product-mini/platforms/linux
114+
llvm_cache_key: ${{ needs.build_llvm_libraries_on_ubuntu_2004.outputs.cache_key }}
94115
runner: ubuntu-20.04
95116
upload_url: ${{ needs.create_release.outputs.upload_url }}
96117
ver_num: ${{ needs.create_tag.outputs.new_ver}}
97118

98119
release_iwasm_on_ubuntu_2204:
99-
needs: [create_tag, create_release]
120+
needs: [create_tag, create_release, build_llvm_libraries_on_ubuntu_2204]
100121
uses: ./.github/workflows/build_iwasm_release.yml
101122
with:
102123
cwd: product-mini/platforms/linux
124+
llvm_cache_key: ${{ needs.build_llvm_libraries_on_ubuntu_2204.outputs.cache_key }}
103125
runner: ubuntu-22.04
104126
upload_url: ${{ needs.create_release.outputs.upload_url }}
105127
ver_num: ${{ needs.create_tag.outputs.new_ver}}
106128

107129
release_iwasm_on_macos:
108-
needs: [create_tag, create_release]
130+
needs: [create_tag, create_release, build_llvm_libraries_on_macos]
109131
uses: ./.github/workflows/build_iwasm_release.yml
110132
with:
111133
cwd: product-mini/platforms/darwin
134+
llvm_cache_key: ${{ needs.build_llvm_libraries_on_macos.outputs.cache_key }}
112135
runner: macos-latest
113136
upload_url: ${{ needs.create_release.outputs.upload_url }}
114137
ver_num: ${{ needs.create_tag.outputs.new_ver}}

product-mini/platforms/android/build_llvm.sh

+1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
# Copyright (C) 2020 Intel Corporation. All rights reserved.
44
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55

6+
/usr/bin/env python3 -m pip install --user -r ../../../build-scripts/requirements.txt
67
/usr/bin/env python3 ../../../build-scripts/build_llvm.py --platform android "$@"

product-mini/platforms/darwin/build_llvm.sh

+1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
# Copyright (C) 2020 Intel Corporation. All rights reserved.
44
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55

6+
/usr/bin/env python3 -m pip install --user -r ../../../build-scripts/requirements.txt
67
/usr/bin/env python3 ../../../build-scripts/build_llvm.py --platform darwin "$@"

product-mini/platforms/freebsd/build_llvm.sh

+1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
# Copyright (C) 2020 Intel Corporation. All rights reserved.
44
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55

6+
/usr/bin/env python3 -m pip install --user -r ../../../build-scripts/requirements.txt
67
/usr/bin/env python3 ../../../build-scripts/build_llvm.py "$@"

product-mini/platforms/linux/build_llvm.sh

+1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
# Copyright (C) 2020 Intel Corporation. All rights reserved.
44
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55

6+
/usr/bin/env python3 -m pip install --user -r ../../../build-scripts/requirements.txt
67
/usr/bin/env python3 ../../../build-scripts/build_llvm.py "$@"

test-tools/wamr-ide/WASM-Toolchain/Docker/Dockerfile

+6-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ COPY resource /root/
1212
## - download cmake with wget and set up
1313
# hadolint ignore=DL3008
1414
RUN wget --progress=dot:giga https://github.com/Kitware/CMake/releases/download/v3.21.1/cmake-3.21.1-linux-x86_64.tar.gz \
15-
&& tar -zxvf cmake-3.21.1-linux-x86_64.tar.gz \
15+
&& tar -zxf cmake-3.21.1-linux-x86_64.tar.gz \
1616
&& rm -f cmake-3.21.1-linux-x86_64.tar.gz \
1717
&& mv cmake-3.21.1-linux-x86_64 /opt/cmake \
1818
&& ln -s /opt/cmake/bin/cmake /bin/cmake \
@@ -26,13 +26,17 @@ RUN wget --progress=dot:giga https://github.com/Kitware/CMake/releases/download/
2626

2727
## - download wasi-sdk with wget and set up to /opt/wasi-sdk
2828
RUN wget --progress=dot:giga https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-19/wasi-sdk-19.0-linux.tar.gz \
29-
&& tar -zxvf wasi-sdk-*-linux.tar.gz \
29+
&& tar -zxf wasi-sdk-*-linux.tar.gz \
3030
&& mv wasi-sdk-19.0 /opt/wasi-sdk/ \
3131
&& rm -f wasi-sdk-*-linux.tar.gz
3232

3333
## - clone wamr repo
3434
RUN git clone -b main --depth=1 https://github.com/bytecodealliance/wasm-micro-runtime.git
3535

36+
WORKDIR /root/wasm-micro-runtime/build-scripts
37+
RUN apt-get update && apt-get install --no-install-recommends -y ccache ninja-build python3-pip
38+
RUN pip3 install --user -r requirements.txt
39+
3640
WORKDIR /root/wasm-micro-runtime/wamr-compiler
3741
RUN ./build_llvm.sh \
3842
&& mkdir build

wamr-compiler/build_llvm.sh

+1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
# Copyright (C) 2020 Intel Corporation. All rights reserved.
44
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55

6+
/usr/bin/env python3 -m pip install --user -r ../build-scripts/requirements.txt
67
/usr/bin/env python3 ../build-scripts/build_llvm.py "$@"

wamr-compiler/build_llvm_arc.sh

+1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
# Copyright (C) 2020 Intel Corporation. All rights reserved.
44
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55

6+
/usr/bin/env python3 -m pip install --user -r ../build-scripts/requirements.txt
67
/usr/bin/env python3 ../build-scripts/build_llvm.py --platform arc "$@"

wamr-compiler/build_llvm_xtensa.sh

+1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
# Copyright (C) 2020 Intel Corporation. All rights reserved.
44
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55

6+
/usr/bin/env python3 -m pip install --user -r ../build-scripts/requirements.txt
67
/usr/bin/env python3 ../build-scripts/build_llvm.py --platform xtensa "$@"

0 commit comments

Comments
 (0)