Skip to content

Commit

Permalink
feat: add semantic release workflow (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
vasyl-ivanchuk authored Sep 15, 2023
1 parent 69e6b82 commit d36a71b
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 104 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release

on:
push:
branches:
- main
- '[0-9]+.*'

jobs:
createReleaseVersion:
name: Create Release Version
runs-on: ubuntu-latest
outputs:
releaseVersion: ${{ steps.release.outputs.releaseVersion }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

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

- name: Install dependencies
run: |
npm ci
- name: Lint
run: |
npm run lint -- -- --no-fix --max-warnings 0
- name: Test
run: |
npm run test:unit:ci
- name: Create Release Version
id: release
env:
GITHUB_TOKEN: ${{ github.token }}
run: npx semantic-release
39 changes: 39 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"branches": [
"+([0-9])?(.{+([0-9]),x}).x",
"main",
"next",
"next-major",
{
"name": "beta",
"prerelease": true
},
{
"name": "alpha",
"prerelease": true
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
[
"@semantic-release/npm",
{
"npmPublish": false
}
],
[
"@semantic-release/github",
{
"assets": []
}
],
[
"@semantic-release/exec",
{
"successCmd": "echo '::set-output name=releaseVersion::${nextRelease.version}'"
}
]
]
}
Loading

0 comments on commit d36a71b

Please sign in to comment.