on:
  release:
    types: [published]

name: release

jobs:
  build_test_and_publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - name: install node
        uses: actions/setup-node@v3
        with:
          node-version: 20
          registry-url: https://registry.npmjs.org/

      - name: install
        run: yarn install

      - name: build
        run: yarn build

      - name: test
        run: yarn execution-tests

      - run: npm publish
        env:
          NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
