update release action

This commit is contained in:
McKayla Washburn 2023-11-09 19:07:41 -07:00
parent 009209253a
commit bdfa77339a
No known key found for this signature in database

View file

@ -5,27 +5,34 @@ on:
tags: ["v*"]
jobs:
build:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.1.0
- uses: erlef/setup-beam@v1.16.0
- 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