Skip to content

Commit

Permalink
feat: STRF-10157 Introduce Semantic Release (#1008)
Browse files Browse the repository at this point in the history
  • Loading branch information
jairo-bc authored Oct 26, 2022
1 parent 15fc14e commit 085684d
Show file tree
Hide file tree
Showing 7 changed files with 10,687 additions and 8,472 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/pull_request_review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ jobs:
- name: Install Dependencies
run: npm ci

- name: Verify Github PR Title
run: echo "${{ github.event.pull_request.title }}" | npx commitlint

- name: Verify Git Commit Name
run: git log -1 --pretty=format:"%s" | npx commitlint

- name: Lint the code
run: npm run lint

Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,21 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '14.x'
- run: npm ci
- name: Check Git Commit name
run: git log -1 --pretty=format:"%s" | npx commitlint
# Setup .npmrc file to publish to npm registry
- run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
- run: npm publish
- name: Deploy to npm and git
run: npm config list && npm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GA_USERNAME: ${{ secrets.PAT_USERNAME }}
GA_TOKEN: ${{ secrets.PAT_TOKEN }}

build-and-push-image:
env:
Expand Down
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx commitlint --edit $1
16 changes: 16 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"branches": ["master"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/github",
"@semantic-release/npm",
[
"semantic-release-github-pullrequest", {
"assets": ["CHANGELOG.md", "package.json"],
"baseRef": "master"
}
]
]
}
7 changes: 6 additions & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
module.exports = { extends: ['@commitlint/config-conventional'] };
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'subject-case': [0, 'always', 'sentence-case'],
},
};
Loading

0 comments on commit 085684d

Please sign in to comment.