Merge pull request #458 from wilzbach/release

Deploy binaries to GitHub releases (Linux/MacOS)
merged-on-behalf-of: BBasile <BBasile@users.noreply.github.com>
This commit is contained in:
The Dlang Bot 2018-04-01 18:51:35 +02:00 committed by GitHub
commit 7e39f75070
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 58 additions and 0 deletions

View File

@ -17,3 +17,34 @@ env:
- BUILD=dub - BUILD=dub
script: ./.travis.sh script: ./.travis.sh
jobs:
include:
- stage: GitHub Release
if: tag IS present
d: ldc
os: linux
script: echo "Deploying to GitHub releases ..." && make release
deploy:
provider: releases
api_key: $GH_REPO_TOKEN
file_glob: true
file: bin/dcd-*.tar.gz
skip_cleanup: true
on:
repo: dlang-community/dcd
tags: true
- stage: GitHub Release
if: tag IS present
d: ldc
os: osx
script: echo "Deploying to GitHub releases ..." && make release
deploy:
provider: releases
api_key: $GH_REPO_TOKEN
file_glob: true
file: bin/dcd-*.tar.gz
skip_cleanup: true
on:
repo: dlang-community/dcd
tags: true

View File

@ -14,6 +14,8 @@ DPARSE_DIR := libdparse
DSYMBOL_DIR := dsymbol DSYMBOL_DIR := dsymbol
STDXALLOC_DIR := stdx-allocator STDXALLOC_DIR := stdx-allocator
SHELL:=/bin/bash
githash: githash:
git log -1 --format="%H" > githash.txt git log -1 --format="%H" > githash.txt
@ -147,3 +149,28 @@ ldcserver: githash
test: debugserver dmdclient test: debugserver dmdclient
cd tests && ./run_tests.sh cd tests && ./run_tests.sh
.ONESHELL:
release:
@set -eux -o pipefail
VERSION=$$(git describe --abbrev=0 --tags)
ARCH="$${ARCH:-64}"
unameOut="$$(uname -s)"
case "$$unameOut" in
Linux*) OS=linux; ;;
Darwin*) OS=osx; ;;
*) echo "Unknown OS: $$unameOut"; exit 1
esac
case "$$ARCH" in
64) ARCH_SUFFIX="x86_64";;
32) ARCH_SUFFIX="x86";;
*) echo "Unknown ARCH: $$ARCH"; exit 1
esac
archiveName="dcd-$$VERSION-$$OS-$$ARCH_SUFFIX.tar.gz"
echo "Building $$archiveName"
${MAKE} ldcclient
${MAKE} ldcserver
tar cvfz "bin/$$archiveName" -C bin dcd-client dcd-server