From bdfa77339affadb4a8c62c3c476c721ee308eafc Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Thu, 9 Nov 2023 19:07:41 -0700 Subject: [PATCH] update release action --- .github/workflows/release.yml | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 626a484..1d2a0aa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 \ No newline at end of file + - uses: softprops/action-gh-release@v1