ultra-minimal pubsub module written in TypeScript
image: nixos/latest
packages:
  - nixos.bun
  - nixos.nodejs_20
  - nixos.pijul
environment:
  project: pubsub
secrets:
  - 2b8f0d2a-cab9-451d-b684-6b89582fb7b0 # NPM publish token
tasks:
  - setup: |
      pijul clone https://nest.pijul.com/rasch/"$project"
      cd "$project"
      bun install
  - stop_if_not_release: |
      cd "$project"
      # NOTE: pijul doesn't clone the tags yet, so this is not in service
      #current=$(pijul log --limit 1 --state | grep '^State' | cut -d ' ' -f 2)
      #tag=$(pijul tag | grep '^State' | cut -d ' ' -f 2)
      #test "$current" = "$tag" || complete-build
  - release: |
      cd "$project"
      bun run build
      bun run build-min
      echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' >> .npmrc
      set +x
      . ~/.env
      set -x
      npm publish --access public