Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
# llvm 9 build is broken on windows for now. Re-enable this when it is fixed:
# - windows-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v1
with:
submodules: true
- run: |
Expand All @@ -40,3 +40,8 @@ jobs:
- run: sudo make -j4 package
shell: bash
name: Build
- uses: actions/upload-artifact@v1
with:
# Upload the dist folder. Give it a name according to the OS it was built for.
name: ${{ format( 'dist-{0}.tgz', matrix.os) }}
path: dist
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,9 @@ strip: build/llvm.BUILT
package: build/package.BUILT

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

.PHONY: default clean build strip package
11 changes: 9 additions & 2 deletions deb_from_installation.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
#!/usr/bin/env sh
set -ex
if [ -n "$1" ]; then
export VERSION="$1"
OUTDIR=$1
else
export VERSION=`./version.sh`
OUTDIR=$PWD/dist
fi

if [ -n "$2" ]; then
VERSION="$2"
else
VERSION=`./version.sh`
fi

rm -rf build/pkg
Expand All @@ -12,3 +18,4 @@ mkdir -p build/pkg/DEBIAN
sed -e s/VERSION/$VERSION/ wasi-sdk.control > build/pkg/DEBIAN/control
cp -R /opt/wasi-sdk build/pkg/opt/
cd build && dpkg-deb -b pkg wasi-sdk_$VERSION\_amd64.deb
mv build/wasi-sdk_$VERSION\amd64.deb $OUTDIR/
14 changes: 10 additions & 4 deletions tar_from_installation.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#!/usr/bin/env bash
set -ex
if [ -n "$1" ]; then
VERSION="$1"
OUTDIR=$1
else
OUTDIR=$PWD/dist
fi

if [ -n "$2" ]; then
VERSION="$2"
else
VERSION=`./version.sh`
fi
Expand All @@ -19,10 +25,10 @@ esac
rm -rf $PKGDIR
cp -R /opt/wasi-sdk $PKGDIR
cd build
tar czf wasi-sdk-$VERSION\-$MACHINE.tar.gz wasi-sdk-$VERSION
tar czf $OUTDIR/wasi-sdk-$VERSION\-$MACHINE.tar.gz wasi-sdk-$VERSION

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