Skip to content

Commit

Permalink
feat: Add shareable semantic-release config
Browse files Browse the repository at this point in the history
  • Loading branch information
jhnns committed Nov 14, 2024
1 parent 8430851 commit e0b585a
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 23 deletions.
24 changes: 1 addition & 23 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,3 @@
{
"branches": ["main", { "name": "beta", "prerelease": true }],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
[
"@semantic-release/git",
{
"assets": ["CHANGELOG.md"]
}
],
"@semantic-release/github",
"@semantic-release/npm",
[
"@semantic-release/exec",
{
"verifyConditionsCmd": "echo //npm.pkg.github.com/:_authToken=${process.env.GITHUB_TOKEN} > /tmp/github.npmrc && npm whoami --userconfig /tmp/github.npmrc --registry https://npm.pkg.github.com/",
"publishCmd": "npm publish --userconfig /tmp/github.npmrc --tag ${nextRelease.channel} --registry https://npm.pkg.github.com/ --no-git-tag-version",
"successCmd": "rm /tmp/github.npmrc",
"failCmd": "rm /tmp/github.npmrc"
}
]
]
"extends": "./semantic-release/base.js"
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"./eslint/styles/prefer-array-shorthand": "./eslint/styles/prefer-array-shorthand.js",
"./eslint/styles/prefer-interface": "./eslint/styles/prefer-interface.js",
"./prettier": "./prettier/base.js",
"./semantic-release": "./semantic-release/base.js",
"./typescript": "./typescript/base.js"
},
"files": [
Expand Down
38 changes: 38 additions & 0 deletions semantic-release/base.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
export default {
branches: ["main", { name: "beta", prerelease: true }],
plugins: [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
[
"@semantic-release/git",
{
assets: ["CHANGELOG.md"],
},
],
[
"@semantic-release/npm",
{
tarballDir: ".semantic-release",
},
],
[
"@semantic-release/github",
{
assets: ".semantic-release/*.tgz",
},
],
[
"@semantic-release/exec",
{
verifyConditionsCmd:
'echo "registry=https://npm.pkg.github.com/\n//npm.pkg.github.com/:_authToken=${process.env.GITHUB_TOKEN}" > /tmp/github.npmrc && npm whoami --userconfig /tmp/github.npmrc',
prepareCmd: "npx -y prettier --write CHANGELOG.md",
publishCmd:
"npm publish --userconfig /tmp/github.npmrc --tag ${nextRelease.channel} --no-git-tag-version",
successCmd: "rm /tmp/github.npmrc",
failCmd: "rm /tmp/github.npmrc",
},
],
],
};

0 comments on commit e0b585a

Please sign in to comment.