Skip to content

Commit

Permalink
fix: added semantic release
Browse files Browse the repository at this point in the history
  • Loading branch information
mBlomsterberg committed Oct 24, 2023
1 parent d4692e2 commit 6bd7dc9
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Semantic Release

on:
push:

jobs:
release:
name: Create release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
token: ${{ secrets.PAT }}

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install dependencies
working-directory: .
run: npm install

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
run: npx semantic-release
46 changes: 46 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"branches": [
"+([0-9])?(.{+([0-9]),x}).x",
"main",
"next",
"next-major",
{ "name": "release", "prerelease": true },
{ "name": "beta", "prerelease": true },
{ "name": "alpha", "prerelease": true }
],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "angular",
"releaseRules": [
{ "type": "breaking", "release": "major" },
{ "type": "refactor", "release": "patch" },
{ "type": "fix", "release": "patch" },
{ "type": "docs", "release": "patch" },
{ "type": "feat", "release": "minor" }
],
"parserOpts": {
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES"]
}
}
],
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/github",
[
"@semantic-release/exec",
{
"verifyReleaseCmd": "echo ${nextRelease.version} > version.txt"
}
],
[
"@semantic-release/git",
{
"assets": ["CHANGELOG.md", "package.json"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
],
"extends": "@semantic-release/gitlab-config"
}
26 changes: 26 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "github-cheatsheet",
"version": "0.0.0-development",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"semantic-release": "semantic-release"
},
"author": "[email protected]",
"license": "MIT",
"devDependencies": {
"@semantic-release/gitlab-config": "^8.0.0",
"semantic-release": "^17.4.7",
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/commit-analyzer": "^8.0.1",
"@semantic-release/exec": "^5.0.0",
"@semantic-release/git": "^9.0.0",
"@semantic-release/npm": "^7.0.10",
"@semantic-release/release-notes-generator": "^9.0.2"
},
"repository": {
"type": "git",
"url": "https://github.com/mBlomsterberg/github-cheatsheet.git"
}
}

0 comments on commit 6bd7dc9

Please sign in to comment.