From 99a2d3742d92bf5aa4bb1cf111850edb4229bed2 Mon Sep 17 00:00:00 2001 From: REJack Date: Sun, 6 Aug 2023 17:47:28 +0200 Subject: [PATCH] chore: add github release action --- .github/workflows/release.yml | 50 +++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000000..4adea24a4ae --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,50 @@ +name: Release & Publish + +on: + push: + tags: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Clone repository + uses: actions/checkout@v3 + with: + persist-credentials: false + + - name: Set env + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: "${{ env.NODE }}" + cache: npm + + - name: Install npm dependencies + run: npm ci + + - name: Build distribution files + run: npm run production + + - name: Zip distribution files + uses: montudor/action-zip@v1 + with: + args: "zip -qq admin-lte-${{env.RELEASE_VERSION}}.zip -d dist" + + - name: Create changelog text + id: changelog + uses: endaft/action-changelog@v0.0.5 + with: + token: ${{ secrets.GITHUB_TOKEN }} + exclude_types: other,doc,chore + + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + body: ${{ steps.changelog.outputs.changelog }} + files: | + admin-lte.${{env.RELEASE_VERSION}}.zip