forked from WasmEdge/WasmEdge
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (68 loc) · 2.57 KB
/
reusable-build-on-manylinux.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Build on manylinux
on:
workflow_call:
inputs:
version:
type: string
required: true
matrix: # [ { name, runner, docker_tag }, ... ]
type: string
required: true
release:
type: boolean
permissions:
contents: read
jobs:
build_on_manylinux:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(inputs.matrix) }}
name: ${{ matrix.name }}
runs-on: ${{ matrix.runner }}
container: wasmedge/wasmedge:${{ matrix.docker_tag }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Ensure git safe directory
run: |
git config --global --add safe.directory $(pwd)
- name: Build ${{ matrix.docker_tag }} package
run: |
bash utils/docker/build-manylinux.sh
./build/tools/wasmedge/wasmedge -v
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
path: build/WasmEdge-${{ inputs.version }}-Linux.tar.gz
name: WasmEdge-${{ inputs.version }}-${{ matrix.docker_tag }}.tar.gz
- name: Install gh on manylinux
if: ${{ inputs.release }}
run: |
type -p yum-config-manager >/dev/null || sudo yum install yum-utils
yum-config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo
yum install -y gh
- name: Upload rpm package
if: ${{ inputs.release }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv build/WasmEdge-${{ inputs.version }}-Linux.rpm WasmEdge-${{ inputs.version }}-${{ matrix.docker_tag }}.rpm
gh release upload ${{ inputs.version }} WasmEdge-${{ inputs.version }}-${{ matrix.docker_tag }}.rpm --clobber
- name: Upload tar.gz package
if: ${{ inputs.release }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv build/WasmEdge-${{ inputs.version }}-Linux.tar.gz WasmEdge-${{ inputs.version }}-${{ matrix.docker_tag }}.tar.gz
gh release upload ${{ inputs.version }} WasmEdge-${{ inputs.version }}-${{ matrix.docker_tag }}.tar.gz --clobber
- name: Upload tar.xz package
if: ${{ inputs.release }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv build/WasmEdge-${{ inputs.version }}-Linux.tar.xz WasmEdge-${{ inputs.version }}-${{ matrix.docker_tag }}.tar.xz
gh release upload ${{ inputs.version }} WasmEdge-${{ inputs.version }}-${{ matrix.docker_tag }}.tar.xz --clobber