From ebf32fd688aea369816c4b98b38e8aa6097aceee Mon Sep 17 00:00:00 2001 From: Nathan Monteleone Date: Wed, 19 Oct 2022 14:26:52 -0500 Subject: [PATCH 1/3] automatic hex upload --- .travis/upload.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 .travis/upload.sh diff --git a/.travis/upload.sh b/.travis/upload.sh new file mode 100755 index 0000000..fd3849b --- /dev/null +++ b/.travis/upload.sh @@ -0,0 +1,12 @@ + #!/bin/bash + +set -e + +# Upload packages to hex +# Only do so when on master + +if [[ ! -z "$TRAVIS_TAG" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then + mix hex.publish --organization simplifi --yes +else + echo "Skipping upload" +fi From 6b1ed404c24e9b24180d89e7d1cd9fffb66dbddb Mon Sep 17 00:00:00 2001 From: Nathan Monteleone Date: Wed, 19 Oct 2022 14:41:51 -0500 Subject: [PATCH 2/3] Add the missing step to upload --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 2ba8a51..7467f6b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,3 +32,6 @@ install: script: - ./scripts/ci_build.sh + +after_success: + - .travis/upload.sh \ No newline at end of file From 5d5b9ee0e96329f7f2a17e3b76dec695ded93d7f Mon Sep 17 00:00:00 2001 From: Nathan Monteleone Date: Wed, 19 Oct 2022 15:01:39 -0500 Subject: [PATCH 3/3] Use the upload.sh from co_mix -- it's correct for a public hex package --- .travis/upload.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis/upload.sh b/.travis/upload.sh index fd3849b..4a53dcc 100755 --- a/.travis/upload.sh +++ b/.travis/upload.sh @@ -1,12 +1,12 @@ - #!/bin/bash +#!/bin/bash set -e # Upload packages to hex -# Only do so when on master +# Only do so when a new version is tagged if [[ ! -z "$TRAVIS_TAG" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then - mix hex.publish --organization simplifi --yes + mix hex.publish --yes else echo "Skipping upload" fi