publish.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. name: Publish
  2. on:
  3. push:
  4. tags: ["v*"]
  5. jobs:
  6. publish:
  7. runs-on: ubuntu-latest
  8. permissions:
  9. contents: write
  10. id-token: write
  11. steps:
  12. - uses: actions/checkout@v4
  13. - uses: oven-sh/setup-bun@v2
  14. with:
  15. bun-version: latest
  16. - name: Install SQLite
  17. run: sudo apt-get update && sudo apt-get install -y libsqlite3-dev
  18. - run: bun install
  19. - run: bun test --timeout 30000 --preload ./src/test-preload.ts test/
  20. env:
  21. CI: true
  22. LD_LIBRARY_PATH: /usr/lib/x86_64-linux-gnu
  23. - uses: actions/setup-node@v4
  24. with:
  25. node-version: 22
  26. registry-url: https://registry.npmjs.org
  27. - run: npm run build
  28. - run: npm publish --provenance --access public
  29. env:
  30. NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
  31. - name: Extract release notes
  32. id: notes
  33. run: |
  34. VERSION="${GITHUB_REF_NAME#v}"
  35. NOTES=$(./scripts/extract-changelog.sh "$VERSION")
  36. # Write to file for gh release (avoids quoting issues)
  37. echo "$NOTES" > /tmp/release-notes.md
  38. - name: Create GitHub release
  39. run: |
  40. gh release create "$GITHUB_REF_NAME" \
  41. --title "$GITHUB_REF_NAME" \
  42. --notes-file /tmp/release-notes.md
  43. env:
  44. GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}