I want to publish a whole directory (the build directory) on a Github release using semantic-release but unfortunately it releases each build file as a single asset.
For reproduction:
- I'm using the Vue CLI to generate a project
vue create foo
- Install semantic-release as a dev dependency
npm install --save-dev semantic-release
- Install the Github plugin for semantic-release
npm install @semantic-release/github -D
- Create a
.releaserc.json
with the content
.
{
"plugins":[
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/github",
{
"assets":[
{
"path":"dist",
"label":"foo-${nextRelease.gitTag}"
}
]
}
]
]
}
- Inside the package.json set the
version
key to0.0.0-development
- Create a .github/workflows directory with the workflow 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
- Commit and push it with
feat: pushed
The release seems to be fine but unfortunately it didn't publish the dist directory as a single asset.
It simply published each file inside dist as a single
Adding the step
- name: Log
run: ls
shows that the dist directory exists
How can I fix that?