Skip to content

Commit

Permalink
Avoid YAML syntax quirks by creating a script
Browse files Browse the repository at this point in the history
  • Loading branch information
rzane committed Oct 4, 2020
1 parent 3f3f94d commit 5593bf2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ jobs:
- name: Dependencies
run: mix deps.get

- name: Set version
run: |
perl -pi -e "s/version: \"0.0.0\"/version: \"${GITHUB_REF:11}\"/" mix.exs
- name: Publish
run: mix hex.publish --yes
run: bin/publish "${GITHUB_REF:11}"
env:
HEX_API_KEY: ${{ secrets.HEX_TOKEN }}
11 changes: 11 additions & 0 deletions bin/publish
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

set -euo pipefail

if [ $# -ne 1 ]; then
echo "Missing required argument: version"
exit 1
fi

perl -pi -e "s/version: \"0.0.0\"/version: \"$1\"/" mix.exs
mix hex.publish --yes

0 comments on commit 5593bf2

Please sign in to comment.