release.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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@v3
  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