-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
采用尤大同款
- Loading branch information
Showing
1 changed file
with
12 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |