diff --git a/.github/workflows/npm_publish.yaml b/.github/workflows/npm_publish.yaml index d422d2d..afb83b7 100644 --- a/.github/workflows/npm_publish.yaml +++ b/.github/workflows/npm_publish.yaml @@ -1,6 +1,8 @@ name: Node.js Package Publish on: push: + tags: + - "*" branches: - main jobs: @@ -14,8 +16,11 @@ jobs: - name: yarn install run: yarn install - name: yarn lib - run: yarn lib + run: | + yarn lib + zip -rq emqx-ui.zip ./lib - id: publish + if: startsWith(github.ref, 'refs/tags/') uses: JS-DevTools/npm-publish@v1 with: token: ${{ secrets.NPM_TOKEN }} @@ -23,3 +28,25 @@ jobs: - if: steps.publish.outputs.type != 'none' run: | echo "Version changed: ${{ steps.publish.outputs.old-version }} => ${{ steps.publish.outputs.version }}" + - name: Create Release + if: startsWith(github.ref, 'refs/tags/') + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: EMQ X UI ${{ github.ref }} Released + draft: false + prerelease: false + - name: Upload Release Asset + if: startsWith(github.ref, 'refs/tags/') + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./emqx-ui.zip + asset_name: emqx-ui.zip + asset_content_type: application/zip