prepare-release.yml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. name: Prepare Release
  2. on:
  3. workflow_dispatch:
  4. push:
  5. tags:
  6. - 'v*'
  7. env:
  8. CI: true
  9. permissions:
  10. contents: read
  11. jobs:
  12. build:
  13. permissions:
  14. contents: write # for softprops/action-gh-release to create GitHub release
  15. runs-on: macos-11
  16. timeout-minutes: 15
  17. strategy:
  18. matrix:
  19. node-version: [16]
  20. steps:
  21. - uses: actions/checkout@v3
  22. - run: git fetch --tags -f
  23. - name: Resolve version
  24. id: vars
  25. run: |
  26. echo "TAG_NAME=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
  27. - name: Get release notes
  28. run: |
  29. RELEASE_NOTES=$(node ./scripts/release-notes.js)
  30. echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
  31. echo "$RELEASE_NOTES" >> $GITHUB_ENV
  32. echo "EOF" >> $GITHUB_ENV
  33. - name: Use Node.js ${{ matrix.node-version }}
  34. uses: actions/setup-node@v3
  35. with:
  36. node-version: ${{ matrix.node-version }}
  37. registry-url: 'https://registry.npmjs.org'
  38. - name: Use the `stable` engine
  39. run: |
  40. node ./scripts/swap-engines.js
  41. - name: Install dependencies
  42. run: npm install
  43. - name: Check versions
  44. run: |
  45. echo "Node:" `node --version`
  46. echo "NPM:" `npm --version`
  47. echo "Rust:" `rustc --version`
  48. echo "Cargo:" `cargo --version`
  49. - name: Build Tailwind CSS
  50. run: npm run build
  51. - name: Install standalone cli dependencies
  52. run: npm install
  53. working-directory: standalone-cli
  54. - name: Build standalone cli
  55. run: npm run build
  56. working-directory: standalone-cli
  57. - name: Test
  58. run: |
  59. npm test || \
  60. npm test || \
  61. npm test || exit 1
  62. working-directory: standalone-cli
  63. - name: Release
  64. uses: softprops/action-gh-release@v1
  65. with:
  66. draft: true
  67. tag_name: ${{ env.TAG_NAME }}
  68. body: |
  69. ${{ env.RELEASE_NOTES }}
  70. files: |
  71. standalone-cli/dist/tailwindcss-linux-arm64
  72. standalone-cli/dist/tailwindcss-linux-armv7
  73. standalone-cli/dist/tailwindcss-linux-x64
  74. standalone-cli/dist/tailwindcss-macos-arm64
  75. standalone-cli/dist/tailwindcss-macos-x64
  76. standalone-cli/dist/tailwindcss-windows-x64.exe
  77. standalone-cli/dist/tailwindcss-windows-arm64.exe