I want to release the tag every time I push it. #2835
-
Every time a tag is pushed with githubactions, I try to release it using semantic release release.yml name: Release
on:
push:
tags:
- v**
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- name: Pnpm setup
uses: pnpm/action-setup@v2
with:
version: 8
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
check-latest: true
cache: "pnpm"
- name: Install dependencies
run: pnpm install --prod --frozen-lockfile
- name: Semantic-release
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
run: pnpm semantic-release --branches release.config.js module.exports = {
branches: ["main"],
plugins: [
[
"@semantic-release/release-notes-generator",
{
preset: "conventionalcommits",
presetConfig: {
types: [
/**
* @see
* https://github.com/semantic-release/release-notes-generator
* https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.0.0/README.md
*/
{ type: "feat", section: "✨ Features", hidden: false },
{ type: "fix", section: "🐛 Bug Fixes", hidden: false },
{ type: "docs", section: "📝 Docs", hidden: false },
{ type: "ui", section: "💅 UI", hidden: false },
{ type: "style", section: "💄 Styles", hidden: false },
{ type: "test", section: "✅ Tests", hidden: true },
{ type: "revert", section: "🕐 Reverts", hidden: false },
{ type: "refactor", section: "♻️ Refactor", hidden: false },
{ type: "perf", section: "🌈 Performance", hidden: false },
{ type: "chore", section: "📦 Chores", hidden: true },
{ type: "ci", section: "💫 CI/CD", hidden: false },
],
},
},
],
[
"@semantic-release/changelog",
{
changelogFile: "CHANGELOG.md",
changelogTitle: "# 🚦 CHANGELOG",
},
],
[
"@semantic-release/git",
{
assets: ["CHANGELOG.md"],
},
],
[
"@semantic-release/github",
{
assets: [{ path: "CHANGELOG.md", label: "Changelog" }],
},
],
],
}; But if I do this, it doesn't release
So I put "refs/tags/v**" in the branches and they said it was invalid branch. What should I do... |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Your use case is outside the scope of semantic-release. You already have a version tag name, you don't need semantic-release to calculate the version. Setup |
Beta Was this translation helpful? Give feedback.
Your use case is outside the scope of semantic-release. You already have a version tag name, you don't need semantic-release to calculate the version. Setup
semantic-release
to run onpush
to your default branch instead.