Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
name: Semantic Release and Publish

# Trigger only when release branch gets new commits (PR merge)
# Trigger only when PR from main to release is merged
on:
push:
pull_request:
types:
- closed
branches:
- release

jobs:
release:
name: Release
runs-on: ubuntu-latest
# Only run if PR was merged (not just closed)
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'release' && github.event.pull_request.head.ref == 'main'

# Needed permissions for tags, releases, etc.
permissions:
contents: write
issues: write
pull-requests: write

steps:
# 1️⃣ Checkout full repo including history and tags
# 1️⃣ Checkout repository with full history and tags
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: release
fetch-depth: 0

# 2️⃣ Setup Node.js
Expand All @@ -33,7 +37,10 @@ jobs:

# 3️⃣ Install dependencies
- name: Install dependencies
run: npm ci
run: |
npm ci
# 🔑 Ensure all semantic-release plugins are installed
npm install --save-dev @semantic-release/git @semantic-release/npm @semantic-release/github @semantic-release/release-notes-generator @semantic-release/commit-analyzer

# 4️⃣ Run tests
- name: Run tests
Expand Down
7 changes: 2 additions & 5 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
{
"branches": ["release"],
"branches": ["main"],
"tagFormat": "v${version}",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",

["@semantic-release/npm", {
"npmPublish": true
}],

["@semantic-release/git", {
"assets": ["package.json"],
"message": "chore(release): ${nextRelease.version} [skip ci]"
}],

"@semantic-release/github"
]
}
}
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 10 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
{
"name": "react-chef",
"version": "0.2.0",
"version": "0.3.0",
"private": false,
"publishConfig": {
"access": "public"
},
"description": "Transparent React Boilerplate Apps",
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/web-slate/react-chef.git"
},
"repository": "web-slate/react-chef",
"engine": {
"node": "10",
"npm": "5"
Expand All @@ -37,5 +34,13 @@
"commander": "^7.1.0",
"inquirer": "^8.0.0",
"shelljs": "^0.8.4"
},
"devDependencies": {
"semantic-release": "^22.0.12",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^9.2.6",
"@semantic-release/npm": "^11.0.2",
"@semantic-release/commit-analyzer": "^11.1.0",
"@semantic-release/release-notes-generator": "^12.1.0"
}
}
Loading