mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-13 06:15:33 +00:00
Trying to autoplublish releases
This commit is contained in:
parent
3e5b3b1838
commit
36f46342bc
@ -12,11 +12,61 @@ jobs:
|
|||||||
- run: sudo apt-get install -y cmake
|
- run: sudo apt-get install -y cmake
|
||||||
- run: rustup default nightly-2018-10-07
|
- run: rustup default nightly-2018-10-07
|
||||||
- run: make test
|
- run: make test
|
||||||
|
- run:
|
||||||
|
command: |
|
||||||
|
make release
|
||||||
|
mkdir -p artifacts
|
||||||
|
cp ./target/release/wasmer ./artifacts/$(./binary-name.sh)
|
||||||
|
- persist_to_workspace:
|
||||||
|
root: .
|
||||||
|
paths:
|
||||||
|
- artifacts
|
||||||
- save_cache:
|
- save_cache:
|
||||||
paths:
|
paths:
|
||||||
- /usr/local/cargo/registry
|
- /usr/local/cargo/registry
|
||||||
- target/debug/.fingerprint
|
- target/debug/.fingerprint
|
||||||
- target/debug/build
|
- target/debug/build
|
||||||
- target/debug/deps
|
- target/debug/deps
|
||||||
|
- target/release/build
|
||||||
|
- target/release/deps
|
||||||
key: v4-cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }}
|
key: v4-cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }}
|
||||||
|
|
||||||
|
# create-release-artifacts-mac:
|
||||||
|
# macos:
|
||||||
|
# xcode: "9.0"
|
||||||
|
# - checkout
|
||||||
|
|
||||||
|
publish-github-release:
|
||||||
|
docker:
|
||||||
|
- image: cibuilds/github
|
||||||
|
steps:
|
||||||
|
- attach_workspace:
|
||||||
|
at: .
|
||||||
|
- run:
|
||||||
|
name: "Publish Release on GitHub"
|
||||||
|
command: |
|
||||||
|
# go get github.com/tcnksm/ghr
|
||||||
|
# VERSION=$(git log -1 --pretty=%B)
|
||||||
|
VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2)
|
||||||
|
# VERSION=${CIRCLE_TAG}
|
||||||
|
# VERSION=$(./artifacts/ --version)
|
||||||
|
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${VERSION} ./artifacts/
|
||||||
|
|
||||||
|
workflows:
|
||||||
|
version: 2
|
||||||
|
main:
|
||||||
|
jobs:
|
||||||
|
- build
|
||||||
|
# :
|
||||||
|
# filters:
|
||||||
|
# tags:
|
||||||
|
# only: /^\d+\.\d+\.\d+$/
|
||||||
|
|
||||||
|
- publish-github-release:
|
||||||
|
requires:
|
||||||
|
- build
|
||||||
|
# filters:
|
||||||
|
# branches:
|
||||||
|
# ignore: /.*/
|
||||||
|
# tags:
|
||||||
|
# only: /^\d+\.\d+\.\d+$/
|
||||||
|
14
Makefile
14
Makefile
@ -5,7 +5,7 @@ spectests:
|
|||||||
WASM_GENERATE_SPECTESTS=1 cargo build
|
WASM_GENERATE_SPECTESTS=1 cargo build
|
||||||
|
|
||||||
# clean:
|
# clean:
|
||||||
# rm -rf target
|
# rm -rf artifacts
|
||||||
|
|
||||||
build:
|
build:
|
||||||
cargo build
|
cargo build
|
||||||
@ -15,3 +15,15 @@ install:
|
|||||||
|
|
||||||
test:
|
test:
|
||||||
cargo test -- --test-threads=1
|
cargo test -- --test-threads=1
|
||||||
|
|
||||||
|
release:
|
||||||
|
# If you are in OS-X, you will need mingw-w64 for cross compiling to windows
|
||||||
|
# brew install mingw-w64
|
||||||
|
cargo build --release
|
||||||
|
# mkdir -p artifacts
|
||||||
|
# BINARY_NAME := $(./binary-name.sh)
|
||||||
|
# cp ./target/release/wasmer ./artifacts/$(./binary-name.sh)
|
||||||
|
# cp ./target/release/wasmer ./artifacts/${BINARY_NAME}
|
||||||
|
|
||||||
|
publish-release:
|
||||||
|
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${VERSION} ./artifacts/
|
||||||
|
44
binary-name.sh
Executable file
44
binary-name.sh
Executable file
@ -0,0 +1,44 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
initArch() {
|
||||||
|
ARCH=$(uname -m)
|
||||||
|
if [ -n "$WASMER_ARCH" ]; then
|
||||||
|
ARCH="$WASMER_ARCH"
|
||||||
|
fi
|
||||||
|
case $ARCH in
|
||||||
|
amd64) ARCH="amd64";;
|
||||||
|
x86_64) ARCH="amd64";;
|
||||||
|
i386) ARCH="386";;
|
||||||
|
*) echo "Architecture ${ARCH} is not supported by this installation script"; exit 1;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
initOS() {
|
||||||
|
OS=$(uname | tr '[:upper:]' '[:lower:]')
|
||||||
|
if [ -n "$WASMER_OS" ]; then
|
||||||
|
echo "Using WASMER_OS"
|
||||||
|
OS="$WASMER_OS"
|
||||||
|
fi
|
||||||
|
case "$OS" in
|
||||||
|
darwin) OS='darwin';;
|
||||||
|
linux) OS='linux';;
|
||||||
|
freebsd) OS='freebsd';;
|
||||||
|
mingw*) OS='windows';;
|
||||||
|
msys*) OS='windows';;
|
||||||
|
*) echo "OS ${OS} is not supported by this installation script"; exit 1;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
# identify platform based on uname output
|
||||||
|
initArch
|
||||||
|
initOS
|
||||||
|
|
||||||
|
# determine install directory if required
|
||||||
|
BINARY="wasmer-${OS}-${ARCH}"
|
||||||
|
|
||||||
|
# add .exe if on windows
|
||||||
|
if [ "$OS" = "windows" ]; then
|
||||||
|
BINARY="$BINARY.exe"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "${BINARY}"
|
Loading…
Reference in New Issue
Block a user