Deploy binaries to GitHub releases (Linux/MacOS)

This commit is contained in:
Sebastian Wilzbach 2018-03-28 06:59:25 +02:00
parent c668bdcf50
commit 8cc49f574e
2 changed files with 58 additions and 0 deletions

View File

@ -17,3 +17,34 @@ env:
- BUILD=dub
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
STDXALLOC_DIR := stdx-allocator
SHELL:=/bin/bash
githash:
git log -1 --format="%H" > githash.txt
@ -147,3 +149,28 @@ ldcserver: githash
test: debugserver dmdclient
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