Skip to content

Commit

Permalink
Merge pull request #7 from Gold-Labs/feat/release-it
Browse files Browse the repository at this point in the history
Feat/release it
  • Loading branch information
youngkyo0504 authored Dec 31, 2023
2 parents 8e8c8a0 + cccb300 commit 4afb82b
Show file tree
Hide file tree
Showing 6 changed files with 1,812 additions and 39 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release & Publish to NPM
on:
push:
branches:
- 'main'
jobs:
release:
runs-on: ubuntu-20.04
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Set Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Initialize Git user
run: |
git config --global user.email "keumky2@gmail.com"
git config --global user.name "Release Workflow"
- name: Initialize the NPM config
run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Run install
uses: borales/actions-yarn@v4
with:
cmd: install
- name: Run release
uses: borales/actions-yarn@v4
with:
cmd: release --ci
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN : ${{ secrets.NPM_TOKEN }}

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ web_modules/

# Optional npm cache directory
.npm
.npmrc

# Optional eslint cache
.eslintcache
Expand Down Expand Up @@ -131,4 +132,4 @@ dist
# SvelteKit build / generate output
.svelte-kit

# End of https://www.toptal.com/developers/gitignore/api/node
# End of https://www.toptal.com/developers/gitignore/api/node
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

20 changes: 20 additions & 0 deletions .release-it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"git": {
"commitMessage": "chore: release ${version}",
"tagName": "v${version}",
"requireBranch" : "main",
"requireUpstream": false,
"requireCleanWorkingDir": false,
"changelog": "git log --pretty=format:\"* %s (%h)\" ${from}...${to}"
},
"npm": {
"publish": true
},
"github": {
"release": true
},
"hooks": {
"before:init" : "yarn build",
"after:bump": "npx auto-changelog -p"
}
}
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "typescript-boilerplate",
"name": "create-typescript-boilerplate",
"version": "0.0.1",
"description": "boilerplate for typescript project",
"main": "index.js",
Expand All @@ -12,10 +12,11 @@
"test": "jest",
"dev": "npm run typecheck -- --watch & tsx watch ./src/main.ts",
"clean": "rm -rf dist ./dist",
"dev:cli": "node bin/start.js"
"dev:cli": "node bin/start.js",
"release": "release-it"
},
"bin": {
"typescript-boilerplate": "bin/cli.js"
"create-typescript-boilerplate": "bin/cli.js"
},
"engines": {
"node": ">=18.17.0",
Expand All @@ -35,6 +36,7 @@
"jest": "29.6.2",
"lefthook": "1.5.5",
"prettier": "3.0.0",
"release-it": "^17.0.1",
"rimraf": "5.0.1",
"supertest": "6.1.6",
"ts-jest": "29.1.1",
Expand Down
Loading

0 comments on commit 4afb82b

Please sign in to comment.