Skip to content

Commit

Permalink
Publish via Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
tank-bohr committed Mar 1, 2020
1 parent 2b74776 commit cca345d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/publish.yml
@@ -0,0 +1,15 @@
name: Publish to hex.pm
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: gleam-lang/setup-erlang@v1.0.0
with:
otp-version: 22.2
- run: ./scripts/publish.sh
env:
HEX_API_KEY: ${{ secrets.HEX_KEY }}
13 changes: 3 additions & 10 deletions scripts/publish.sh
@@ -1,17 +1,10 @@
#!/usr/bin/env bash

# The script was taken from http://blog.erlware.org/automatic-hex-package-publishing-with-travis-ci/

## Setup hex user
mkdir -p ~/.hex
echo '{username,<<"'${HEX_USERNAME}'">>}.' > ~/.hex/hex.config
echo '{key,<<"'${HEX_KEY}'">>}.' >> ~/.hex/hex.config
set -ex

## Add the rebar3 hex plugin to global
mkdir -p ~/.config/rebar3
echo '{plugins, [rebar3_hex]}.' > ~/.config/rebar3/rebar.config
echo '{plugins, [{rebar3_hex, ">= 6.9.3"}]}.' > ~/.config/rebar3/rebar.config

rebar3 hex publish <<EOF
y
EOF
rebar3 hex publish --yes --repo=hexpm
rebar3 hex docs

0 comments on commit cca345d

Please sign in to comment.