From 05f70e344eadadbd74c7c0361d4a03bc87f2b970 Mon Sep 17 00:00:00 2001 From: hiroki osame Date: Tue, 21 Feb 2023 07:56:01 -0500 Subject: [PATCH] ci: setup semantic-release (#89) --- .github/workflows/release.yml | 33 +++++++++++++++++++++++++++++++++ package.json | 8 ++++++-- 2 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..93b9224 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +name: Release + +on: + push: + branches: [main] + +jobs: + release: + name: Release + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' + + - name: Setup pnpm + uses: pnpm/action-setup@v2.2.2 + with: + version: 7 + run_install: true + + - name: Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: pnpm dlx semantic-release diff --git a/package.json b/package.json index 93df964..0a92813 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aicommits", - "version": "1.0.7", + "version": "0.0.0-semantic-release", "description": "Writes your git commit messages for you with AI", "keywords": [ "ai", @@ -19,7 +19,8 @@ "prepare": "simple-git-hooks", "build": "pkgroll --minify", "lint": "eslint --cache .", - "type-check": "tsc" + "type-check": "tsc", + "prepack": "pnpm build" }, "simple-git-hooks": { "pre-commit": "pnpm lint-staged" @@ -46,5 +47,8 @@ }, "eslintConfig": { "extends": "@pvtnbr" + }, + "release": { + "branches": ["main"] } }