From d75e4a4224ba834b4cf519f31b35a1185d2e2d6d Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Mon, 25 Nov 2019 14:58:42 -0800 Subject: [PATCH] build: put artifacts into dist/. workflow: upload contents of dist/. --- .github/workflows/main.yml | 4 ++++ Makefile | 10 +++++----- deb_from_installation.sh | 11 +++++++++-- tar_from_installation.sh | 14 ++++++++++---- 4 files changed, 28 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 31228c4..6c2162b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,3 +40,7 @@ jobs: - run: sudo make -j4 package shell: bash name: Build + - uses: actions/upload-artifact@v1 + with: + name: ${{ format( 'packages-{0}.tgz', matrix.os) }} + path: dist diff --git a/Makefile b/Makefile index f09a901..552c951 100644 --- a/Makefile +++ b/Makefile @@ -149,11 +149,11 @@ build: build/llvm.BUILT build/wasi-libc.BUILT build/compiler-rt.BUILT build/libc strip: build/llvm.BUILT cd $(PREFIX)/bin; strip clang-9 lld llvm-ar -package: build/package.BUILT +package: dist -build/package.BUILT: build strip - command -v dpkg-deb >/dev/null && ./deb_from_installation.sh || true - ./tar_from_installation.sh - touch build/package.BUILT +dist: build strip + mkdir -p dist + command -v dpkg-deb >/dev/null && ./deb_from_installation.sh $(shell pwd)/dist || true + ./tar_from_installation.sh $(shell pwd)/dist .PHONY: default clean build strip package diff --git a/deb_from_installation.sh b/deb_from_installation.sh index a1c1b6b..19037d4 100755 --- a/deb_from_installation.sh +++ b/deb_from_installation.sh @@ -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/build +fi + +if [ -n "$2" ]; then + VERSION="$2" +else + VERSION=`./version.sh` fi rm -rf build/pkg @@ -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/ diff --git a/tar_from_installation.sh b/tar_from_installation.sh index dc8dae5..634cd1f 100755 --- a/tar_from_installation.sh +++ b/tar_from_installation.sh @@ -1,7 +1,13 @@ #!/usr/bin/env bash set -ex if [ -n "$1" ]; then - VERSION="$1" + OUTDIR=$1 +else + OUTDIR=$PWD/build +fi + +if [ -n "$2" ]; then + VERSION="$2" else VERSION=`./version.sh` fi @@ -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