Skip to content

Commit

Permalink
feat: enabled semantic release
Browse files Browse the repository at this point in the history
  • Loading branch information
eliasrosa committed Mar 10, 2024
1 parent d413085 commit 7bf3e5c
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/semantic-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Semantic Release

on:
push:
branches:
- main

jobs:
release:
runs-on: ubuntu-latest
outputs:
VERSION: ${{ steps.run-release.outputs.VERSION }}
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false

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

- name: Install and Run
id: run-release
env:
DEBUG: semantic-release:github
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
npm install --global semantic-release @semantic-release/github @semantic-release/changelog @semantic-release/git @semantic-release/exec
npx semantic-release
- name: Output version
run: echo ${{ steps.run-release.outputs.VERSION }}
19 changes: 19 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"semantic-release-github",
["@semantic-release/npm", {
"npmPublish": false
}],
["@semantic-release/git", {
"assets": ["package.json", "CHANGELOG.md"],
"message": "Bump version: ${nextRelease.version} \n\n${nextRelease.notes}"
}],
["@semantic-release/exec", {
"prepareCmd": "echo '::set-output name=VERSION::${nextRelease.version}'"
}]
]
}

0 comments on commit 7bf3e5c

Please sign in to comment.