Skip to content

Commit

Permalink
release CI: Windows artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
TianlongLiang committed Oct 9, 2024
1 parent deacb7a commit c0e1e9d
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 9 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/build_iwasm_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,15 @@ jobs:
cmake --build build --config Release --parallel 4
working-directory: ${{ inputs.cwd }}

- name: compress the binary
- name: Compress the binary on Windows
if: runner.os == 'windows-latest'
run: |
tar -czf iwasm-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz iwasm
Compress-Archive -Path iwasm -DestinationPath iwasm-${{ inputs.ver_num }}-${{ inputs.runner }}.zip
working-directory: ${{ inputs.cwd }}/build

- name: compress the binary on non-Windows
if: runner.os != 'windows-latest'
run: |
tar czf iwasm-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz iwasm
zip iwasm-${{ inputs.ver_num }}-${{ inputs.runner }}.zip iwasm
Expand Down
38 changes: 32 additions & 6 deletions .github/workflows/build_llvm_libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ jobs:
- name: checkout
uses: actions/checkout@v4

- name: install dependencies for non macos-14
if: inputs.os != 'macos-14'
- name: install dependencies for non macos-14 and non Windows
if: inputs.os != 'macos-14' && runner.os != 'windows-latest'
run: /usr/bin/env python3 -m pip install -r requirements.txt
working-directory: build-scripts

Expand All @@ -51,16 +51,25 @@ jobs:
run: /usr/bin/env python3 -m pip install -r requirements.txt --break-system-packages
working-directory: build-scripts

- name: Install dependencies (Windows)
if: runner.os == 'windows-latest'
run: python -m pip install -r requirements.txt
working-directory: build-scripts

- name: Set Python path env variable for non Windows
if: runner.os != 'windows-latest'
run: echo "PYTHON_ENV_PATH=/usr/bin/env" >> $GITHUB_ENV

- name: retrieve the last commit ID
id: get_last_commit
run: echo "last_commit=$(GH_TOKEN=${{ secrets.GITHUB_TOKEN }} /usr/bin/env python3 ./build_llvm.py ${{ inputs.extra_build_llvm_options }} --llvm-ver)" >> $GITHUB_OUTPUT
run: echo "last_commit=$(GH_TOKEN=${{ secrets.GITHUB_TOKEN }} $PYTHON_ENV_PATH python3 ./build_llvm.py ${{ inputs.extra_build_llvm_options }} --llvm-ver)" >> $GITHUB_OUTPUT
working-directory: build-scripts

# Bump the prefix number to evict all previous caches and
# enforce a clean build, in the unlikely case that some
# weird build error occur and llvm/build becomes a potential
# suspect.
- name: form the cache key of libraries
- name: Form the cache key of libraries
id: create_lib_cache_key
run: echo "key=0-llvm-libraries-${{ inputs.os }}-${{ inputs.arch }}-${{ steps.get_last_commit.outputs.last_commit }}${{ inputs.cache_key_suffix }}" >> $GITHUB_OUTPUT

Expand Down Expand Up @@ -107,7 +116,24 @@ jobs:
- run: brew install ccache ninja
if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true' && startsWith(inputs.os, 'macos')

- name: Build LLVM libraries
if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true'
- uses: actions/cache@v4
with:
path: ~/.cache/ccache
key: 0-ccache-${{ inputs.os }}-${{ steps.get_last_commit.outputs.last_commit }}
restore-keys: |
0-ccache-${{ inputs.os }}
if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true' && inputs.os == 'windows-latest'

# Install tools on Windows
- run: choco install -y ccache ninja
if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true' && inputs.os == 'windows-latest'

- name: Build LLVM libraries on non Windows
if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true' && inputs.os != 'windows-latest'
run: /usr/bin/env python3 ./build_llvm.py ${{ inputs.extra_build_llvm_options }} --arch ${{ inputs.arch }}
working-directory: build-scripts

- name: Build LLVM libraries on Windows
if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true' && inputs.os == 'windows-latest'
run: python3 ./build_llvm.py ${{ inputs.extra_build_llvm_options }} --arch ${{ inputs.arch }}
working-directory: build-scripts
11 changes: 9 additions & 2 deletions .github/workflows/build_wamrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,15 @@ jobs:
cmake --build build --config Release --parallel 4
working-directory: wamr-compiler

- name: compress the binary
if: inputs.release
- name: Compress the binary on Windows
if: runner.os == 'windows-latest' && inputs.release
run: |
tar -czf wamrc-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz wamrc
Compress-Archive -Path wamrc -DestinationPath wamrc-${{ inputs.ver_num }}-${{ inputs.runner }}.zip
working-directory: wamr-compiler/build

- name: compress the binary on non-Windows
if: runner.os != 'windows-latest' && inputs.release
run: |
tar czf wamrc-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz wamrc
zip wamrc-${{ inputs.ver_num }}-${{ inputs.runner }}.zip wamrc
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/release_process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ jobs:
os: "macos-13"
arch: "AArch64 ARM Mips RISCV X86"

build_llvm_libraries_on_windows:
needs: [create_tag, create_release]
uses: ./.github/workflows/build_llvm_libraries.yml
with:
os: "windows-latest"
arch: "AArch64 ARM Mips RISCV X86"

#
# WAMRC
release_wamrc_on_ubuntu_2004:
Expand Down Expand Up @@ -103,6 +110,16 @@ jobs:
runner: macos-13
upload_url: ${{ needs.create_release.outputs.upload_url }}
ver_num: ${{ needs.create_tag.outputs.new_ver }}

release_wamrc_on_windows:
needs: [create_tag, create_release, build_llvm_libraries_on_windows]
uses: ./.github/workflows/build_wamrc.yml
with:
llvm_cache_key: ${{ needs.build_llvm_libraries_on_windows.outputs.cache_key }}
release: true
runner: windows-latest
upload_url: ${{ needs.create_release.outputs.upload_url }}
ver_num: ${{ needs.create_tag.outputs.new_ver }}

#
# IWASM
Expand Down Expand Up @@ -136,6 +153,16 @@ jobs:
upload_url: ${{ needs.create_release.outputs.upload_url }}
ver_num: ${{ needs.create_tag.outputs.new_ver}}

release_iwasm_on_windows:
needs: [create_tag, create_release, build_llvm_libraries_on_windows]
uses: ./.github/workflows/build_iwasm_release.yml
with:
cwd: product-mini/platforms/windows
llvm_cache_key: ${{ needs.build_llvm_libraries_on_windows.outputs.cache_key }}
runner: windows-latest
upload_url: ${{ needs.create_release.outputs.upload_url }}
ver_num: ${{ needs.create_tag.outputs.new_ver}}

#
# WAMR_SDK
release_wamr_sdk_on_ubuntu_2004:
Expand Down

0 comments on commit c0e1e9d

Please sign in to comment.