-
Notifications
You must be signed in to change notification settings - Fork 11
133 lines (128 loc) · 4.32 KB
/
release.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Release
on:
push:
tags:
- 'v*'
jobs:
build-wasi-vfs-cli:
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-pc-windows-gnu
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-latest
- target: aarch64-apple-darwin
os: macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions-rs/[email protected]
with:
command: build
args: --release --target=${{ matrix.target }} --package wasi-vfs-cli
use-cross: true
- run: |
zip --junk-paths wasi-vfs-cli-${{ matrix.target }} target/${{ matrix.target }}/release/wasi-vfs{,.exe}
- uses: actions/upload-artifact@v1
with:
name: wasi-vfs-cli-${{ matrix.target }}
path: wasi-vfs-cli-${{ matrix.target }}.zip
build-libwasi-vfs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Install wasi-sdk
run: |
set -e
wasi_sdk_deb="wasi-sdk_${WASI_SDK_VERSION_MAJOR}.${WASI_SDK_VERSION_MINOR}_amd64.deb"
wget "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION_MAJOR}/${wasi_sdk_deb}"
sudo dpkg -i "$wasi_sdk_deb"
echo "WASI_SDK_PATH=/opt/wasi-sdk" >> $GITHUB_ENV
env:
WASI_SDK_VERSION_MAJOR: 20
WASI_SDK_VERSION_MINOR: 0
- uses: actions-rs/[email protected]
with:
command: build
args: --release --target=wasm32-unknown-unknown
- run: |
zip --junk-paths libwasi_vfs-wasm32-unknown-unknown target/wasm32-unknown-unknown/release/libwasi_vfs.a
- uses: actions/upload-artifact@v1
with:
name: libwasi_vfs-wasm32-unknown-unknown
path: libwasi_vfs-wasm32-unknown-unknown.zip
create-release:
needs: [build-wasi-vfs-cli, build-libwasi-vfs]
runs-on: ubuntu-latest
steps:
- id: create-release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- run: |
echo '${{ steps.create-release.outputs.upload_url }}' > release_upload_url.txt
- uses: actions/upload-artifact@v1
with:
name: create-release
path: release_upload_url.txt
upload-cli-release:
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- x86_64-pc-windows-gnu
- x86_64-apple-darwin
- aarch64-apple-darwin
needs: [create-release]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v1
with:
name: create-release
- id: upload-url
run: |
echo "::set-output name=url::$(cat create-release/release_upload_url.txt)"
- uses: actions/download-artifact@v1
with:
name: wasi-vfs-cli-${{ matrix.target }}
- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.upload-url.outputs.url }}
asset_path: ./wasi-vfs-cli-${{ matrix.target }}/wasi-vfs-cli-${{ matrix.target }}.zip
asset_name: wasi-vfs-cli-${{ matrix.target }}.zip
asset_content_type: application/zip
upload-lib-release:
needs: [create-release]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v1
with:
name: create-release
- id: upload-url
run: |
echo "::set-output name=url::$(cat create-release/release_upload_url.txt)"
- uses: actions/download-artifact@v1
with:
name: libwasi_vfs-wasm32-unknown-unknown
- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.upload-url.outputs.url }}
asset_path: ./libwasi_vfs-wasm32-unknown-unknown/libwasi_vfs-wasm32-unknown-unknown.zip
asset_name: libwasi_vfs-wasm32-unknown-unknown.zip
asset_content_type: application/zip