Update release scripts

This commit is contained in:
Sebastian Wilzbach 2018-04-23 19:04:17 +02:00
parent 15f5b11977
commit 14c8b7cc9f
4 changed files with 79 additions and 30 deletions

View File

@ -17,14 +17,13 @@ env:
- BUILD=dub
script: ./.travis.sh
jobs:
include:
- stage: GitHub Release
if: tag IS present
d: ldc
#if: tag IS present
d: ldc-1.8.0
os: linux
script: echo "Deploying to GitHub releases ..." && make release
script: echo "Deploying to GitHub releases ..." && ./release.sh
deploy:
provider: releases
api_key: $GH_REPO_TOKEN
@ -35,10 +34,10 @@ jobs:
repo: dlang-community/dcd
tags: true
- stage: GitHub Release
if: tag IS present
d: ldc
#if: tag IS present
d: ldc-1.8.0
os: osx
script: echo "Deploying to GitHub releases ..." && make release
script: echo "Deploying to GitHub releases ..." && ./release.sh
deploy:
provider: releases
api_key: $GH_REPO_TOKEN
@ -48,3 +47,27 @@ jobs:
on:
repo: dlang-community/dcd
tags: true
- stage: GitHub Release
#if: tag IS present
d: dmd
os: linux
language: generic
sudo: yes
script: echo "Deploying to GitHub releases ..." && ./release-windows.sh
addons:
apt:
packages:
- p7zip-full
- wine
deploy:
provider: releases
api_key: $GH_REPO_TOKEN
file_glob: true
file: bin/dcd-.*.zip
skip_cleanup: true
on:
repo: dlang-community/dcd
tags: true
stages:
- name: test
if: type = pull_request or (type = push and branch = master)

View File

@ -150,27 +150,5 @@ 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
./release.sh

25
release-windows.sh Executable file
View File

@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Build the Windows binaries under Linux (requires wine)
set -eux -o pipefail
VERSION=$(git describe --abbrev=0 --tags)
OS=windows
ARCH_SUFFIX="x86"
# Allow the script to be run from anywhere
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR
# Step 1: download the DMD binaries
if [ ! -d dmd2 ] ; then
wget http://downloads.dlang.org/releases/2.x/2.079.0/dmd.2.079.0.windows.7z
7z x dmd.2.079.0.windows.7z > /dev/null
fi
# Step 2: Run DMD via wineconsole
archiveName="dcd-$VERSION-$OS-$ARCH_SUFFIX.zip"
echo "Building $archiveName"
mkdir -p bin
DC="$DIR/dmd2/windows/bin/dmd.exe" wine cmd /C build.bat
cd bin
zip "$archiveName" dcd-server.exe dcd-client.exe

23
release.sh Executable file
View File

@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -eux -o pipefail
VERSION=$(git describe --abbrev=0 --tags)
ARCH="${ARCH:-64}"
LDC_FLAGS=()
unameOut="$(uname -s)"
case "$unameOut" in
Linux*) OS=linux; LDC_FLAGS=("-flto=full" "-linker=gold" "-static") ;;
Darwin*) OS=osx; LDC_FLAGS+=("-L-macosx_version_min" "-L10.7" "-L-lcrt1.o"); ;;
*) 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:-make} ldcclient ldcserver LDC_FLAGS="${LDC_FLAGS[*]}"
tar cvfz "bin/$archiveName" -C bin dcd-server dcd-client