我想使用语义发布在 Github 版本上发布整个目录(构建目录),但不幸的是它将每个构建文件作为单个资产发布。
对于复制:
- 我正在使用 Vue CLI 生成项目
vue create foo
- 安装语义释放作为开发依赖项
npm install --save-dev semantic-release
- 安装用于语义发布的 Github 插件
npm install @semantic-release/github -D
- 创建一个
.releaserc.json
与内容
.
{
"plugins":[
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/github",
{
"assets":[
{
"path":"dist",
"label":"foo-${nextRelease.gitTag}"
}
]
}
]
]
}
- 在 - 的里面包.json设置
version
key to 0.0.0-development
- 创建一个.github/工作流程包含工作流程的目录ci.yml
.
name: CI
on:
push:
branches:
- main
jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: 16.x
- name: Install dependencies
run: npm install
- name: Run build
run: npm run build
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release --branches main
该版本似乎不错,但不幸的是它没有发布dist目录作为单一资产。
它只是发布了里面的每个文件dist作为一个单身
添加步骤
- name: Log
run: ls
表明dist目录存在
我该如何解决这个问题?
看来这是不可能的。所以我必须在构建应用程序后添加此步骤
- name: ZIP build
run: zip -r dist.zip dist
并将资产配置设置为
{
"path":"dist.zip",
"label":"foo-${nextRelease.gitTag}.zip"
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)