This repository has been archived on 2023-11-05. You can view files and clone it, but cannot push or open issues or pull requests.
wasm-micro-runtime/.github/workflows/reuse_latest_release_binaries.yml
Wenyong Huang 84161fe084
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.
2022-10-28 13:55:41 +08:00

69 lines
2.1 KiB
YAML

# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name: reuse binaries of the latest release if no more modification on the_path since last_commit
on:
workflow_call:
inputs:
binary_name_stem:
type: string
required: true
last_commit:
type: string
required: true
the_path:
type: string
required: true
upload_url:
description: upload binary assets to the URL of release
type: string
required: true
outputs:
result:
value: ${{ jobs.build.outputs.result }}
jobs:
reuse:
runs-on: ubuntu-latest
outputs:
result: ${{ steps.try_reuse.outputs.result }}
steps:
- uses: actions/checkout@v3
# Full git history is needed to get a proper list of commits and tags
with:
fetch-depth: 0
- name: try to reuse binaries
id: try_reuse
run: |
echo '::echo::on'
python3 ./.github/scripts/reuse_latest_release_binaries.py \
--binary_name_stem ${{ inputs.binary_name_stem }} \
--last_commit ${{ inputs.last_commit }} \
--the_path ${{ inputs.the_path }} .
ls -lh .
- run: echo ${{ steps.try_reuse.outputs.result }}
- name: upload release tar.gz
if: steps.try_reuse.outputs.result == 'hit'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ inputs.upload_url }}
asset_path: ${{ inputs.binary_name_stem }}.tar.gz
asset_name: ${{ inputs.binary_name_stem }}.tar.gz
asset_content_type: application/x-gzip
- name: upload release zip
if: steps.try_reuse.outputs.result == 'hit'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ inputs.upload_url }}
asset_path: ${{ inputs.binary_name_stem }}.zip
asset_name: ${{ inputs.binary_name_stem }}.zip
asset_content_type: application/zip