release.yml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. name: Release
  2. on:
  3. push:
  4. tags:
  5. - "v*"
  6. permissions:
  7. contents: write
  8. jobs:
  9. test:
  10. runs-on: ubuntu-latest
  11. strategy:
  12. matrix:
  13. node-version: [20, 22]
  14. steps:
  15. - uses: actions/checkout@v4
  16. - uses: pnpm/action-setup@v4
  17. with:
  18. version: 9
  19. - uses: actions/setup-node@v4
  20. with:
  21. node-version: ${{ matrix.node-version }}
  22. cache: pnpm
  23. - run: pnpm install --frozen-lockfile
  24. - run: pnpm build
  25. - run: pnpm --filter @actalk/inkos-core typecheck
  26. - run: pnpm --filter @actalk/inkos typecheck
  27. - run: pnpm test
  28. smoke-test:
  29. runs-on: ubuntu-latest
  30. needs: test
  31. steps:
  32. - uses: actions/checkout@v4
  33. - uses: pnpm/action-setup@v4
  34. with:
  35. version: 9
  36. - uses: actions/setup-node@v4
  37. with:
  38. node-version: 22
  39. cache: pnpm
  40. - run: pnpm install --frozen-lockfile
  41. - run: pnpm build
  42. - name: Smoke test — CLI help and version
  43. run: |
  44. node packages/cli/dist/index.js --help
  45. node packages/cli/dist/index.js --version
  46. - name: Smoke test — core import
  47. run: node -e "import('@actalk/inkos-core').then(m => { if (!m.PipelineRunner) throw new Error('missing PipelineRunner'); console.log('core import OK') })"
  48. publish:
  49. runs-on: ubuntu-latest
  50. needs: smoke-test
  51. steps:
  52. - uses: actions/checkout@v4
  53. - uses: pnpm/action-setup@v4
  54. with:
  55. version: 9
  56. - uses: actions/setup-node@v4
  57. with:
  58. node-version: 22
  59. cache: pnpm
  60. registry-url: https://registry.npmjs.org
  61. - run: pnpm install --frozen-lockfile
  62. - run: pnpm build
  63. - run: pnpm -r publish --no-git-checks
  64. env:
  65. NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
  66. github-release:
  67. runs-on: ubuntu-latest
  68. needs: publish
  69. steps:
  70. - uses: actions/checkout@v4
  71. with:
  72. fetch-depth: 0
  73. - name: Generate release notes
  74. id: notes
  75. run: |
  76. PREV_TAG=$(git tag --sort=-creatordate | sed -n '2p' || echo "")
  77. if [ -n "$PREV_TAG" ]; then
  78. echo "notes<<EOF" >> "$GITHUB_OUTPUT"
  79. git log --pretty=format:"- %s (%h)" "$PREV_TAG"..HEAD >> "$GITHUB_OUTPUT"
  80. echo "" >> "$GITHUB_OUTPUT"
  81. echo "EOF" >> "$GITHUB_OUTPUT"
  82. else
  83. echo "notes=Initial release" >> "$GITHUB_OUTPUT"
  84. fi
  85. - uses: softprops/action-gh-release@v2
  86. with:
  87. body: ${{ steps.notes.outputs.notes }}
  88. generate_release_notes: true