Skip to content

Commit

Permalink
add version check to release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
TanklesXL committed May 6, 2024
1 parent ad9d986 commit d389366
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,21 @@ jobs:
test:
uses: TanklesXL/glint/.github/workflows/test.yml@main

version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
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
release-gh:
runs-on: ubuntu-latest
needs: [test]
needs: [test, version]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -20,7 +32,7 @@ jobs:

release-hex:
runs-on: ubuntu-latest
environment: publish
needs: [test, version]
steps:
- uses: actions/checkout@v2
- uses: actions/cache/restore@v4
Expand Down

0 comments on commit d389366

Please sign in to comment.