release.yml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. name: Release & Publish
  2. on:
  3. push:
  4. tags:
  5. - '*'
  6. jobs:
  7. build:
  8. runs-on: ubuntu-latest
  9. steps:
  10. - name: Clone repository
  11. uses: actions/checkout@v4
  12. with:
  13. persist-credentials: false
  14. - name: Set env
  15. run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
  16. - name: Set up Node.js
  17. uses: actions/setup-node@v3
  18. with:
  19. node-version: "${{ env.NODE }}"
  20. cache: npm
  21. - name: Install npm dependencies
  22. run: npm ci
  23. - name: Build distribution files
  24. run: npm run production
  25. - name: Zip distribution files
  26. uses: montudor/action-zip@v1
  27. with:
  28. args: "zip -qq admin-lte-${{env.RELEASE_VERSION}}.zip -d dist"
  29. - name: Create changelog text
  30. id: changelog
  31. uses: endaft/action-changelog@v0.0.5
  32. with:
  33. token: ${{ secrets.GITHUB_TOKEN }}
  34. exclude_types: other,doc,chore
  35. - name: Release
  36. uses: softprops/action-gh-release@v1
  37. if: startsWith(github.ref, 'refs/tags/')
  38. with:
  39. body: ${{ steps.changelog.outputs.changelog }}
  40. files: |
  41. admin-lte.${{env.RELEASE_VERSION}}.zip