Skip to content

Commit

Permalink
update release action
Browse files Browse the repository at this point in the history
  • Loading branch information
aslilac committed Nov 10, 2023
1 parent 0092092 commit bdfa773
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,34 @@ on:
tags: ["v*"]

jobs:
build:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/[email protected]
- uses: erlef/[email protected]
- uses: actions/checkout@v3

- uses: erlef/setup-beam@v1
with:
otp-version: "26.0.2"
gleam-version: "0.30.5"
- run: cargo install tomlq
otp-version: "26.1"
gleam-version: "0.32.4"

- run: |
if [ "v$(tomlq version -f gleam.toml)" == "${{ github.ref_name }}" ]; then
exit 0
version="v$(cat gleam.toml | grep -m 1 "version" | sed -r "s/version *= *\"([[:digit:].]+)\"/\1/")"
if [ "$version" != "${{ github.ref_name }}" ]; then
echo "tag '${{ github.ref_name }}' does not match the version in gleam.toml"
echo "expected a tag name 'v$version'"
exit 1
fi
echo "tag does not match version in gleam.toml, refusing to publish"
exit 1
- run: gleam format --check src test
name: check version
- run: gleam format --check

- run: gleam test --target erlang
- run: gleam test --target javascript

- run: gleam publish -y
env:
HEXPM_USER: ${{ secrets.HEX_USERNAME }}
HEXPM_PASS: ${{ secrets.HEX_PASSWORD }}

- uses: softprops/action-gh-release@v1
- uses: softprops/action-gh-release@v1

0 comments on commit bdfa773

Please sign in to comment.