Skip to content

Commit

Permalink
chore(CI): create release when push tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Rory-Z authored and ysfscream committed Apr 16, 2021
1 parent 4d61c52 commit fee8930
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion .github/workflows/npm_publish.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Node.js Package Publish
on:
push:
tags:
- "*"
branches:
- main
jobs:
Expand All @@ -14,12 +16,37 @@ 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 }}
access: publish
- 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

0 comments on commit fee8930

Please sign in to comment.