-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.yml
52 lines (49 loc) · 1.5 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
version: 2
jobs:
test-and-build-otp-release:
docker:
- image: elaworkshop/halosir-builder:latest
working_directory: ~/app
steps:
- checkout
- run:
name: "Test & Build Release"
command: |
. ~/.asdf/asdf.sh
asdf current
mix deps.get
mix test
MIX_ENV=prod mix distillery.release --profile=halosir:prod
mkdir /artifact
cp _build/prod/rel/halosir/releases/*/halosir.tar.gz /artifact/
mix run --no-start --eval "File.write!(\"/artifact/VERSION\", HaloSir.Mixfile.project[:version])"
- store_artifacts:
path: /artifact/halosir.tar.gz
- persist_to_workspace:
root: /artifact
paths:
- halosir.tar.gz
- VERSION
publish-github-release:
docker:
- image: circleci/golang:1.11.2
steps:
- attach_workspace:
at: ~/work
- run:
name: "Publish Release on GitHub"
command: |
go get github.com/tcnksm/ghr
VERSION=$(cat ~/work/VERSION)
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -n "HaloSir ${VERSION}" -delete ${VERSION} ~/work/halosir.tar.gz
workflows:
version: 2
test-and-release:
jobs:
- test-and-build-otp-release
- publish-github-release:
requires:
- test-and-build-otp-release
filters:
branches:
only: master