Skip to content

Commit

Permalink
feat: add semantic-release
Browse files Browse the repository at this point in the history
  • Loading branch information
pviti committed Nov 22, 2023
1 parent 4baacac commit fa3aee5
Show file tree
Hide file tree
Showing 4 changed files with 4,515 additions and 294 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/semantic-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build package
run: pnpm build
- name: Run specs
env:
CL_SDK_ORGANIZATION: cli-test-org
CL_SDK_CLIENT_ID: SQWYt6tF8bx9uWzxGbrPxEMCEP5dCZbu93r56KRTLPY
CL_SDK_CLIENT_SECRET: DKMUFKTxqjfEc9SMNeG2FKPLqKOdMHYwz1BysAJcObw
run: pnpm test
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpx semantic-release
22 changes: 22 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"ci": true,
"dryRun": false,
"branches": [
{ "name": "main", "channel": "latest" },
"+([0-9])?(.{+([0-9]),x}).x",
{ "name": "beta", "prerelease": true }
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/github",
"@semantic-release/npm",
["@semantic-release/changelog", {
"changelogFile": "CHANGELOG.md"
}],
["@semantic-release/git", {
"assets": [ "package.json", "CHANGELOG.md" ],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}]
]
}
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,17 @@
"@commercelayer/eslint-config-ts": "^1.2.0",
"@oclif/plugin-help": "^5.2.20",
"@oclif/test": "^2.5.6",
"@types/chai": "^4.3.10",
"@types/mocha": "^10.0.4",
"@types/node": "^20.9.2",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@types/chai": "^4.3.11",
"@types/mocha": "^10.0.6",
"@types/node": "^20.9.4",
"chai": "^4.3.10",
"eslint": "^8.54.0",
"mocha": "^10.2.0",
"nyc": "^15.1.0",
"oclif": "^4.0.4",
"semantic-release": "^22.0.8",
"ts-node": "^10.9.1",
"typescript": "5.2.2"
},
Expand Down
Loading

0 comments on commit fa3aee5

Please sign in to comment.