Skip to content

Commit 2c82155

Browse files
authored
Merge pull request #573 from wilzbach/release
Improve the binary release building (Linux, OSX)
2 parents 8b52e51 + f326cad commit 2c82155

File tree

2 files changed

+52
-13
lines changed

2 files changed

+52
-13
lines changed

.travis.yml

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,31 @@ env:
1515
script: "./.travis.sh"
1616
jobs:
1717
include:
18-
- stage: GitHub Release
19-
d: ldc
20-
os: linux
21-
script: echo "Deploying to GitHub releases ..." && make ldcbuild
22-
deploy:
23-
provider: releases
24-
api_key:
25-
secure: pbrrm6E0SPfVwt9g+e/ZFQfrmRuGBNA6KwMMLUhI+2+kbRzNquxvrYAUC7YcRX7xiRL/gugKHmOXEi1Dv9IEdSQ732M06H7ikZT9T9oQWYbsZzmVICBWgIovyM8XIPpVAwP8D7jq0JgMiBicqfEZfoz2SIJjo6aYbyQbCASCu8U=
26-
file: bin/dscanner
27-
skip_cleanup: true
28-
on:
29-
repo: dlang-community/D-Scanner
30-
tags: true
18+
- stage: GitHub Release
19+
if: tag IS present
20+
d: ldc
21+
os: linux
22+
script: echo "Deploying to GitHub releases ..." && make release
23+
deploy:
24+
provider: releases
25+
api_key: $GH_REPO_TOKEN
26+
file_glob: true
27+
file: bin/dscanner-*.tar.gz
28+
skip_cleanup: true
29+
on:
30+
repo: dlang-community/D-Scanner
31+
tags: true
32+
- stage: GitHub Release
33+
if: tag IS present
34+
d: ldc
35+
os: osx
36+
script: echo "Deploying to GitHub releases ..." && make release
37+
deploy:
38+
provider: releases
39+
api_key: $GH_REPO_TOKEN
40+
file_glob: true
41+
file: bin/dscanner-*.tar.gz
42+
skip_cleanup: true
43+
on:
44+
repo: dlang-community/D-Scanner
45+
tags: true

makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,27 @@ clean:
7272
report: all
7373
dscanner --report src > src/dscanner-report.json
7474
sonar-runner
75+
76+
.ONESHELL:
77+
release:
78+
@set -eux -o pipefail
79+
VERSION=$$(git describe --abbrev=0 --tags)
80+
ARCH="$${ARCH:-64}"
81+
unameOut="$$(uname -s)"
82+
case "$$unameOut" in
83+
Linux*) OS=linux; ;;
84+
Darwin*) OS=osx; ;;
85+
*) echo "Unknown OS: $$unameOut"; exit 1
86+
esac
87+
88+
case "$$ARCH" in
89+
64) ARCH_SUFFIX="x86_64";;
90+
32) ARCH_SUFFIX="x86";;
91+
*) echo "Unknown ARCH: $$ARCH"; exit 1
92+
esac
93+
94+
archiveName="dscanner-$$VERSION-$$OS-$$ARCH_SUFFIX.tar.gz"
95+
96+
echo "Building $$archiveName"
97+
${MAKE} ldcbuild
98+
tar cvfz "bin/$$archiveName" -C bin dscanner

0 commit comments

Comments
 (0)