publish.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. - name: Verify lockfile is up-to-date
  19. run: bun install --frozen-lockfile
  20. - run: bun test --timeout 60000 --preload ./src/test-preload.ts test/
  21. env:
  22. CI: true
  23. LD_LIBRARY_PATH: /usr/lib/x86_64-linux-gnu
  24. - uses: actions/setup-node@v4
  25. with:
  26. node-version: 22
  27. registry-url: https://registry.npmjs.org
  28. - run: npm run build
  29. - run: npm publish --provenance --access public
  30. env:
  31. NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
  32. - name: Extract release notes
  33. id: notes
  34. run: |
  35. VERSION="${GITHUB_REF_NAME#v}"
  36. NOTES=$(./scripts/extract-changelog.sh "$VERSION")
  37. # Write to file for gh release (avoids quoting issues)
  38. echo "$NOTES" > /tmp/release-notes.md
  39. - name: Create GitHub release
  40. run: |
  41. gh release create "$GITHUB_REF_NAME" \
  42. --title "$GITHUB_REF_NAME" \
  43. --notes-file /tmp/release-notes.md
  44. env:
  45. GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}