如何在语义发布的Github插件中使用Github操作发布整个目录? [英] How to publish a whole directory using Github Actions with the semantic-release Github plugin?
本文介绍了如何在语义发布的Github插件中使用Github操作发布整个目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望使用语义发布在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创建一个.githorb/workflow目录
。
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目录存在
我如何修复它?
推荐答案
这似乎是不可能的。因此,我必须在构建应用程序后添加此步骤
- name: ZIP build
run: zip -r dist.zip dist
并将资产配置设置为
{
"path":"dist.zip",
"label":"foo-${nextRelease.gitTag}.zip"
}
这篇关于如何在语义发布的Github插件中使用Github操作发布整个目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文