From 6ca8bcddfb6b7d2a8151ad65287df7e669e60631 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=A5=E9=9B=A8=E7=8C=AB?= Date: Wed, 3 Mar 2021 10:18:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0release=20actions=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 采用尤大同款 --- .github/workflows/docs.release.yml | 70 +++++------------------------- 1 file changed, 12 insertions(+), 58 deletions(-) diff --git a/.github/workflows/docs.release.yml b/.github/workflows/docs.release.yml index 6430d0c..4b04ca6 100644 --- a/.github/workflows/docs.release.yml +++ b/.github/workflows/docs.release.yml @@ -1,70 +1,24 @@ -# name属性用来指定这个工作流的名字 +name: Create Release -name: 发布release - -# 这个部分用来指定能够触发工作流执行的事件 on: - # 当对分支main进行push操作的时候,这个工作流就被触发了 push: - branches: [docs-release] - pull_request: - branches: [docs-release] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: + tags: + - v* -# 工作流是由一个或多个的jobs构成的,在jobs里来说明要交给GitHub aciton执行的任务 jobs: - # 这个jobs中的一个任务,名字叫build(随便怎么取) build: - # 用来指定这个任务在什么操作系统上跑(服务器是GitHub免费提供的) + name: Create Release runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [14.x] - - # 指出这个build任务的步骤 steps: - - uses: actions/checkout@v1 - - - name: 初始化node环境 - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - - name: 安装yarn - run: npm i -g yarn + - name: Checkout code + uses: actions/checkout@master - - name: 安装依赖 - run: yarn - - - name: 打包文档 - run: | - yarn docs:build - cd docs - - # 创建release - - name: 打包zip - run: tar -zcvf release.tgz * - - - name: 发布release - id: create_release - uses: actions/create-release@master - env: - GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }} - with: - tag_name: ${{ github.ref }} # (tag)标签名称 - release_name: Release ${{ github.ref }} - draft: false # 是否是草稿 - prerelease: false # 是否是预发布 - - name: 上传release - id: upload-release-asset - uses: actions/upload-release-asset@master + - name: Create Release for Tag + id: release_tag + uses: yyx990803/release-tag@master env: GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }} with: - upload_url: ${{ steps.create_release.outputs.upload_url }} # 上传地址,通过创建Release获取到的 - asset_path: ./release.tgz # 要上传文件 - asset_name: release.tgz # 上传后的文件名 - asset_content_type: application/x-tgz + tag_name: ${{ github.ref }} + body: | + Please refer to [CHANGELOG.md](https://github.com/bhabgs/vite-vui/blob/master/CHANGELOG.md) for details.