Skip to content

Commit

Permalink
ci: use semantic-release for release
Browse files Browse the repository at this point in the history
  • Loading branch information
LironEr committed Apr 11, 2024
1 parent 3bc3bd2 commit 32d0242
Show file tree
Hide file tree
Showing 4 changed files with 3,172 additions and 53 deletions.
22 changes: 2 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,7 @@ jobs:
name: dist
path: dist/

- name: Conventional Changelog Action
id: changelog
uses: TriPSs/conventional-changelog-action@f04dac1fd07687cec8ea302937ca588b33786e98 # v5.2.1
with:
preset: 'conventionalcommits'
output-file: 'false'

- name: Create Release
uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564 # v2.0.4
if: ${{ steps.changelog.outputs.skipped == 'false' }}
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
with:
name: ${{ steps.changelog.outputs.tag }}
tag_name: ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}

- name: Update major tag
uses: actions/publish-action@f784495ce78a41bac4ed7e34a73f0034015764bb # v0.3.0
if: ${{ steps.changelog.outputs.skipped == 'false' }}
with:
source-tag: ${{ steps.changelog.outputs.tag }}
run: yarn release
26 changes: 26 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"branches": [
"main",
{
"name": "next",
"prerelease": true
}
],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"releaseRules": [
{
"type": "chore",
"scope": "deps",
"release": "patch"
}
]
}
],
"@semantic-release/release-notes-generator",
"@semantic-release/github",
"semantic-release-major-tag"
]
}
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"lint": "eslint src/**/*.ts",
"package": "rimraf dist/ && ncc build --source-map --license licenses.txt",
"test": "jest",
"all": "yarn build && yarn format && yarn lint && yarn package && yarn test"
"all": "yarn build && yarn format && yarn lint && yarn package && yarn test",
"release": "semantic-release"
},
"repository": {
"type": "git",
Expand All @@ -38,6 +39,8 @@
"jest": "^29.7.0",
"js-yaml": "^4.1.0",
"prettier": "^3.2.0",
"semantic-release": "^23.0.8",
"semantic-release-major-tag": "^0.3.2",
"ts-jest": "^29.1.1",
"typescript": "^5.3.3"
}
Expand Down
Loading

0 comments on commit 32d0242

Please sign in to comment.