Skip to content

Commit

Permalink
feat: STRF-10157 Introduce Semantic Release
Browse files Browse the repository at this point in the history
  • Loading branch information
jairo-bc committed Oct 21, 2022
1 parent 15fc14e commit 155c616
Show file tree
Hide file tree
Showing 7 changed files with 38,790 additions and 9,888 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/pull_request_review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ 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
9 changes: 8 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,16 @@ jobs:
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 155c616

Please sign in to comment.