Skip to content

Commit

Permalink
Travis configuration for automatically publishing releases
Browse files Browse the repository at this point in the history
When a build is tagged, after tests pass for the "main" build
(Erlang 19 + Rebar3), this attmpts to publish the tag to Hex
  • Loading branch information
waisbrot committed Oct 6, 2016
1 parent 8c8482b commit 2551c5a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .travis.yml
Expand Up @@ -6,6 +6,9 @@ otp_release:
- 18.1
- 19.0
env:
global:
- MAIN_OTP = 19.0
matrix:
- FORCE_REBAR2=true
- FORCE_REBAR2=false PATH=$PATH:$PWD
branches:
Expand All @@ -14,3 +17,10 @@ branches:
install:
- make travis-install
script: make eunit
deploy:
skip_cleanup: true
provider: script
script: make travis-publish
on:
tags: true
condition: $FORCE_REBAR2 = false && $TRAVIS_OTP_RELEASE = $MAIN_OTP
19 changes: 19 additions & 0 deletions Makefile
Expand Up @@ -107,3 +107,22 @@ else
wget https://s3.amazonaws.com/rebar3/rebar3
chmod a+x rebar3
endif

travis-publish:
@echo Create directories
mkdir -p ~/.hex
mkdir -p ~/.config/rebar3

@echo Decrypt secrets
@openssl aes-256-cbc -K $encrypted_9abc06b32f03_key -iv $encrypted_9abc06b32f03_iv -in hex.config.enc -out ~/.hex/hex.config -d

@echo Create global config
echo '{plugins, [rebar3_hex]}.' > ~/.config/rebar3/rebar.config

@echo Edit version tag in app.src
vi -e -c '%s/{vsn, *.*}/{vsn, "'${TRAVIS_TAG}'"}/g|w|q' src/dogstatsd.app.src

@echo Publish to Hex
echo 'Y' | ./vendor/rebar3 hex publish

@echo Done
1 change: 1 addition & 0 deletions hex.config.enc
@@ -0,0 +1 @@
�b��a L�~���3E]5+�!鳺���������!�Pnm6��LfDR!P����"�r���� ���Z�"p"6y��[��

0 comments on commit 2551c5a

Please sign in to comment.