release.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. name: Release
  2. on:
  3. push:
  4. branches:
  5. - main
  6. permissions:
  7. contents: read
  8. pull-requests: write
  9. concurrency: ${{ github.workflow }}-${{ github.ref }}
  10. jobs:
  11. release:
  12. name: Release
  13. runs-on: ubuntu-latest
  14. steps:
  15. - name: Checkout Repo
  16. uses: actions/checkout@v4
  17. - uses: ruby/setup-ruby@v1
  18. with:
  19. bundler-cache: true
  20. - name: Enable corepack
  21. run: corepack enable pnpm
  22. - name: Setup Node.js 18
  23. uses: actions/setup-node@v4
  24. with:
  25. cache: 'pnpm'
  26. node-version: 18
  27. registry-url: 'https://registry.npmjs.org'
  28. - name: Install Dependencies
  29. run: pnpm install
  30. - name: Build Package
  31. run: pnpm run build
  32. - name: Creating .npmrc
  33. run: |
  34. cat << EOF > "$HOME/.npmrc"
  35. //registry.npmjs.org/:_authToken=$NPM_TOKEN
  36. EOF
  37. env:
  38. NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
  39. - name: Create Release Pull Request
  40. uses: changesets/action@v1
  41. with:
  42. publish: pnpm release
  43. env:
  44. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  45. NPM_TOKEN: ${{ secrets.NPM_TOKEN }}