【发布时间】:2021-12-20 15:59:59
【问题描述】:
我想使用语义发布在 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}"
}
]
}
]
]
}
- 在 package.json 中将
version键设置为0.0.0-development - 使用工作流 ci.yml 创建一个 .github/workflows 目录
.
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
- 使用
feat: pushed提交并推送它
该版本似乎很好,但不幸的是它没有将 dist 目录作为单个资产发布。
它只是将 dist 中的每个文件作为单个文件发布
添加步骤
- name: Log
run: ls
表示dist目录存在
我该如何解决这个问题?
【问题讨论】:
标签: github npm github-actions semantic-release