aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/release.yml
blob: d6612fa0dffdbe241a9ccdc0ec51bc19d7d31c9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: release

on:
  push:
    tags: ["v*"]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3.1.0
      - uses: erlef/setup-beam@v1.16.0
        with:
          otp-version: "26.0.2"
          rebar3-version: "3"
          gleam-version: "1.2.1"

      - run: cargo install tomlq
      - run: |
          if [ "v$(tomlq version -f gleam.toml)" == "${{ github.ref_name }}" ]; then
            exit 0
          fi
          echo "tag does not match version in gleam.toml, refusing to publish"
          exit 1
      - run: gleam format --check src test
      - run: gleam test
      - run: gleam publish -y
        env:
          HEXPM_USER: ${{ secrets.HEX_USERNAME }}
          HEXPM_PASS: ${{ secrets.HEX_PASSWORD }}

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