From fc1bec487ac86ca0239fd1c347548cf322b6fabb Mon Sep 17 00:00:00 2001 From: Andrei Neculau Date: Mon, 31 May 2021 00:57:45 +0200 Subject: [PATCH] publish to hex.pm --- .github/workflows/ci.yml | 20 ++++++++++++++++++++ Makefile | 4 ++++ 2 files changed, 24 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e2f8a6..3a5f036 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,3 +66,23 @@ jobs: - if: ${{ matrix.otp_vsn == 'latest' }} shell: bash run: make elvis docs + + # PUBLISH TAGS + + - if: ${{ startsWith(github.ref, 'refs/tags/') }} + name: Check is-semver-tag + id: is-semver-tag + shell: bash + run: | + if [[ ${{ github.event.ref }} =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+ ]]; then + echo ::set-output name=check::true + fi + - if: ${{ matrix.otp_vsn == 'latest' && steps.is-semver-tag.outputs.check == 'true'}} + name: Run make publish + shell: bash + env: + HEX_API_KEY: ${{secrets.HEX_API_KEY}} + run: | + mkdir -p ~/.config/rebar3 + echo "{plugins, [rebar3_hex]}." > ~/.config/rebar3/rebar.config + make publish diff --git a/Makefile b/Makefile index cf95ae9..0ef4c1a 100644 --- a/Makefile +++ b/Makefile @@ -96,6 +96,10 @@ cover: @ $(MAKE) clean-tests $(REBAR) cover -v +.PHONY: publish +publish: docs + $(REBAR) hex publish -r hexpm --yes + .PHONY: rebar3.OTP18 rebar3.OTP18: $(CURL) -fqsS -L -o $@ https://github.com/erlang/rebar3/releases/download/3.13.3/rebar3