release.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. name: Release & Publish
  2. on:
  3. push:
  4. tags:
  5. - '*'
  6. env:
  7. FORCE_COLOR: 2
  8. NODE: 22
  9. jobs:
  10. build:
  11. runs-on: ubuntu-latest
  12. steps:
  13. - name: Clone repository
  14. uses: actions/checkout@v6
  15. with:
  16. persist-credentials: false
  17. - name: Set env
  18. run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
  19. - name: Set up Node.js
  20. uses: actions/setup-node@v6
  21. with:
  22. node-version: "${{ env.NODE }}"
  23. cache: npm
  24. - name: Install npm dependencies
  25. run: npm ci
  26. - name: Build distribution files
  27. run: npm run production
  28. - name: Zip distribution files
  29. uses: montudor/action-zip@v1
  30. with:
  31. args: "zip -qq -r admin-lte-${{env.RELEASE_VERSION}}.zip dist"
  32. - name: Release
  33. uses: softprops/action-gh-release@v2
  34. if: startsWith(github.ref, 'refs/tags/')
  35. with:
  36. # Let GitHub auto-generate the release notes from PRs / commits
  37. # since the previous tag. Replaces the discontinued
  38. # endaft/action-changelog action.
  39. generate_release_notes: true
  40. files: |
  41. admin-lte-${{env.RELEASE_VERSION}}.zip