blob: 4056b0a4b4e8cb41d8eb8ae0a842bfed19dd8847 (
plain)
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
|
name: Build Release
# Trigger whenever a release is created
on:
release:
types:
- created
jobs:
build:
name: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest]
defaults:
run:
shell: bash
steps:
- uses: actions/setup-python@v1
with:
python-version: '3.x'
- uses: actions/checkout@v1
with:
submodules: true
- name: install ninja (osx)
run: brew install ninja
if: matrix.os == 'macos-latest'
- name: install ninja (win)
run: choco install ninja
if: matrix.os == 'windows-latest'
- name: mkdir
run: mkdir -p out
- name: cmake (osx)
run: cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release
if: matrix.os == 'macos-latest'
- name: cmake (win)
# -G "Visual Studio 15 2017"
run: cmake -S . -B out
if: matrix.os == 'windows-latest'
- name: build
run: cmake --build out --config Release
- name: strip
run: find bin/ -type f -perm -u=x -exec strip {} +
if: matrix.os != 'windows-latest'
- name: archive
id: archive
run: |
OSNAME=$(echo ${{ matrix.os }} | sed 's/-latest//')
VERSION=${{ github.event.release.tag_name }}
PKGNAME="binaryen-$VERSION-x86_64-$OSNAME"
TARBALL=$PKGNAME.tar.gz
SHASUM=$PKGNAME.tar.gz.sha256
mv out/bin binaryen-$VERSION
tar -czf $TARBALL binaryen-$VERSION
echo "::set-output name=tarball::$TARBALL"
echo "::set-output name=shasum::$SHASUM"
- name: upload tarball
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ steps.archive.outputs.tarball }}
asset_name: ${{ steps.archive.outputs.tarball }}
asset_content_type: application/gzip
# We do the shasum as a seprate step because this tool doesn't
# exist on windows.
- name: shasum
id: shasum
run: shasum -a 256 ${{ steps.archive.outputs.tarball }} > ${{ steps.archive.outputs.shasum }}
if: matrix.os != 'windows-latest'
- name: upload shasum
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ steps.archive.outputs.shasum }}
asset_name: ${{ steps.archive.outputs.shasum }}
asset_content_type: text/plain
if: matrix.os != 'windows-latest'
# Build with gcc 6.3 and run tests on Alpine Linux (inside chroot).
# Note: Alpine uses musl libc.
build-alpine:
name: alpine
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v1
with:
python-version: '3.x'
- uses: actions/checkout@v1
- name: start docker
run: |
docker run -w /src -dit --name alpine -v $PWD:/src node:lts-alpine
echo 'docker exec alpine "$@";' > ./alpine.sh
chmod +x ./alpine.sh
- name: install packages
run: |
./alpine.sh apk update
./alpine.sh apk add build-base cmake git python3 clang ninja
- name: cmake
run: |
./alpine.sh cmake . -G Ninja -DCMAKE_CXX_FLAGS="-static" -DCMAKE_C_FLAGS="-static" -DCMAKE_BUILD_TYPE=Release
- name: build
run: |
./alpine.sh ninja
- name: test
run: ./alpine.sh python3 ./check.py
- name: archive
id: archive
run: |
VERSION=${{ github.event.release.tag_name }}
PKGNAME="binaryen-$VERSION-x86_64-linux"
TARBALL=$PKGNAME.tar.gz
SHASUM=$PKGNAME.tar.gz.sha256
./alpine find bin/ -type f -perm -u=x -exec strip {} +
mv bin binaryen-$VERSION
tar -czf $TARBALL binaryen-$VERSION
shasum -a 256 $TARBALL > $SHASUM
echo "::set-output name=tarball::$TARBALL"
echo "::set-output name=shasum::$SHASUM"
- name: upload tarball
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ steps.archive.outputs.tarball }}
asset_name: ${{ steps.archive.outputs.tarball }}
asset_content_type: application/gzip
- name: upload shasum
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ steps.archive.outputs.shasum }}
asset_name: ${{ steps.archive.outputs.shasum }}
asset_content_type: text/plain
|