Skip to content

Commit

Permalink
ci: add semantic-release (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis273 committed Aug 7, 2022
1 parent 05a656b commit 3a467a3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 26 deletions.
35 changes: 12 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: Publish Package to npmjs
on:
release:
types: [created]
name: Release
"on":
push:
branches:
- master
- next
- beta
- "*.x"
jobs:
publish:
runs-on: ubuntu-latest
Expand All @@ -14,27 +18,12 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'
node-version: "16.x"
registry-url: "https://registry.npmjs.org"
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm run build
- name: 🚀 Release
uses: cycjimmy/semantic-release-action@v2
with:
semantic_version: 17
branches: |
[
'+([0-9])?(.{+([0-9]),x}).x',
'main',
'master',
'next',
'next-major',
{name: 'beta', prerelease: true},
{name: 'alpha', prerelease: true}
]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm run semantic-release
10 changes: 10 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"branches": [
"main",
{
"name": "next",
"prerelease": true
},
"semantic-release"
]
}
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"name": "@dennis273/geet",
"version": "1.0.0-alpha.3",
"version": "0.0.0-development",
"description": "A command line tool to help handle git repo.",
"repository": "https://github.com/Dennis273/geet.git",
"author": "Dennis273 <[email protected]>",
"license": "MIT",
"private": false,
"scripts": {
"build": "esbuild src/index.ts --platform=node --bundle --outfile=./dist/index.js",
"semantic-release": "semantic-release",
"prepare": "husky install"
},
"files": [
Expand All @@ -23,12 +24,13 @@
"typescript": "4.7.4"
},
"devDependencies": {
"esbuild": "0.14.53"
"esbuild": "0.14.53",
"semantic-release": "19.0.3"
},
"bin": {
"geet": "./dist/index.js"
},
"lint-staged": {
"**/*": "prettier --write --ignore-unknown"
}
}
}

0 comments on commit 3a467a3

Please sign in to comment.