Skip to content

Commit

Permalink
feat(ci): semantic releases
Browse files Browse the repository at this point in the history
  • Loading branch information
Mon4ik committed Dec 14, 2023
1 parent 5c84dd8 commit b968aae
Show file tree
Hide file tree
Showing 4 changed files with 1,689 additions and 15 deletions.
25 changes: 11 additions & 14 deletions .github/workflows/publish.yml → .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: Publish to NPM
name: Release

on:
release:
types: [published]
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-20.04
release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
Expand All @@ -21,13 +23,8 @@ jobs:
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Build package
run: pnpm build

- name: Publish
run: pnpm publish --access public
- name: Semantic Release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
20 changes: 20 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"branches": [
"main"
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
[
"@semantic-release/git",
{
"assets": [
"package.json",
"CHANGELOG.md"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
},
"dependencies": {
"@commander-js/extra-typings": "^11.1.0",
"@semantic-release/commit-analyzer": "^11.1.0",
"@semantic-release/git": "^10.0.1",
"@semantic-release/npm": "^11.0.2",
"axios": "^1.6.2",
"boxen": "^7.1.1",
"chalk": "4.1.2",
Expand All @@ -62,6 +65,7 @@
"pino-pretty": "^10.2.3",
"qrcode-terminal": "^0.12.0",
"qs": "^6.11.2",
"semantic-release": "^22.0.12",
"semver": "^7.5.4"
}
}
Loading

0 comments on commit b968aae

Please sign in to comment.