Skip to content

Commit d75e4a4

Browse files
author
Pat Hickey
committedNov 27, 2019
build: put artifacts into dist/. workflow: upload contents of dist/.
1 parent ac571d0 commit d75e4a4

File tree

4 files changed

+28
-11
lines changed

4 files changed

+28
-11
lines changed
 

‎.github/workflows/main.yml

+4
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,7 @@ jobs:
4040
- run: sudo make -j4 package
4141
shell: bash
4242
name: Build
43+
- uses: actions/upload-artifact@v1
44+
with:
45+
name: ${{ format( 'packages-{0}.tgz', matrix.os) }}
46+
path: dist

‎Makefile

+5-5
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,11 @@ build: build/llvm.BUILT build/wasi-libc.BUILT build/compiler-rt.BUILT build/libc
149149
strip: build/llvm.BUILT
150150
cd $(PREFIX)/bin; strip clang-9 lld llvm-ar
151151

152-
package: build/package.BUILT
152+
package: dist
153153

154-
build/package.BUILT: build strip
155-
command -v dpkg-deb >/dev/null && ./deb_from_installation.sh || true
156-
./tar_from_installation.sh
157-
touch build/package.BUILT
154+
dist: build strip
155+
mkdir -p dist
156+
command -v dpkg-deb >/dev/null && ./deb_from_installation.sh $(shell pwd)/dist || true
157+
./tar_from_installation.sh $(shell pwd)/dist
158158

159159
.PHONY: default clean build strip package

‎deb_from_installation.sh

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
#!/usr/bin/env sh
22
set -ex
33
if [ -n "$1" ]; then
4-
export VERSION="$1"
4+
OUTDIR=$1
55
else
6-
export VERSION=`./version.sh`
6+
OUTDIR=$PWD/build
7+
fi
8+
9+
if [ -n "$2" ]; then
10+
VERSION="$2"
11+
else
12+
VERSION=`./version.sh`
713
fi
814

915
rm -rf build/pkg
@@ -12,3 +18,4 @@ mkdir -p build/pkg/DEBIAN
1218
sed -e s/VERSION/$VERSION/ wasi-sdk.control > build/pkg/DEBIAN/control
1319
cp -R /opt/wasi-sdk build/pkg/opt/
1420
cd build && dpkg-deb -b pkg wasi-sdk_$VERSION\_amd64.deb
21+
mv build/wasi-sdk_$VERSION\amd64.deb $OUTDIR/

‎tar_from_installation.sh

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
#!/usr/bin/env bash
22
set -ex
33
if [ -n "$1" ]; then
4-
VERSION="$1"
4+
OUTDIR=$1
5+
else
6+
OUTDIR=$PWD/build
7+
fi
8+
9+
if [ -n "$2" ]; then
10+
VERSION="$2"
511
else
612
VERSION=`./version.sh`
713
fi
@@ -19,10 +25,10 @@ esac
1925
rm -rf $PKGDIR
2026
cp -R /opt/wasi-sdk $PKGDIR
2127
cd build
22-
tar czf wasi-sdk-$VERSION\-$MACHINE.tar.gz wasi-sdk-$VERSION
28+
tar czf $OUTDIR/wasi-sdk-$VERSION\-$MACHINE.tar.gz wasi-sdk-$VERSION
2329

2430
# As well as the full SDK package, also create archives of libclang_rt.builtins
2531
# and the sysroot. These are made available for users who have an existing clang
2632
# installation.
27-
tar czf libclang_rt.builtins-wasm32-wasi-$VERSION.tar.gz -C compiler-rt lib/wasi
28-
tar czf wasi-sysroot-$VERSION.tar.gz -C wasi-sdk-$VERSION/share wasi-sysroot
33+
tar czf $OUTDIR/libclang_rt.builtins-wasm32-wasi-$VERSION.tar.gz -C compiler-rt lib/wasi
34+
tar czf $OUTDIR/wasi-sysroot-$VERSION.tar.gz -C wasi-sdk-$VERSION/share wasi-sysroot

0 commit comments

Comments
 (0)