Skip to content

Commit 8b26d96

Browse files
committed
Add release action
1 parent 67f610d commit 8b26d96

File tree

5 files changed

+915
-426
lines changed

5 files changed

+915
-426
lines changed

.github/actions/setup/action.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Setup
2+
description: Setup Node.js and install dependencies
3+
inputs:
4+
node-version:
5+
description: Node version
6+
required: false
7+
default: '24'
8+
9+
runs:
10+
using: composite
11+
steps:
12+
- name: Install pnpm
13+
uses: pnpm/action-setup@v4.1.0
14+
15+
- name: Setup Node.js ${{ inputs.node-version }}
16+
uses: actions/setup-node@v4.4.0
17+
with:
18+
node-version: ${{ inputs.node-version }}
19+
registry-url: 'https://registry.npmjs.org'
20+
cache: pnpm
21+
22+
- name: Install dependencies
23+
run: pnpm install
24+
shell: bash

.github/workflows/release.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Release & Publish to NPM & GitHub
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
increment:
6+
description: 'Increment type: major, minor, patch, pre...'
7+
required: true
8+
type: choice
9+
options:
10+
- patch
11+
- minor
12+
- major
13+
- prepatch
14+
- preminor
15+
- premajor
16+
default: patch
17+
18+
jobs:
19+
release:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4.2.2
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Setup
28+
uses: ./.github/actions/setup
29+
30+
- name: Import GPG key
31+
id: import-gpg
32+
uses: crazy-max/ghaction-import-gpg@v6.3.0
33+
with:
34+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
35+
passphrase: ${{ secrets.GPG_PASSPHRASE }}
36+
git_user_signingkey: true
37+
git_commit_gpgsign: true
38+
39+
- run: pnpm run release --increment ${{github.event.inputs.increment}} --ci
40+
env:
41+
# For release-it
42+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
NPM_CONFIG_PROVENANCE: true
45+
# For lerna-changelog
46+
IGNORE_PEER_DEPENDENCIES: release-it
47+
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
48+
49+
permissions:
50+
contents: write
51+
id-token: write

.release-it.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
},
99
"plugins": {
1010
"@release-it-plugins/lerna-changelog": {
11-
"infile": "CHANGELOG.md"
11+
"infile": "CHANGELOG.md",
12+
"launchEditor": false
1213
}
1314
}
1415
}

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
"typecheck": "tsc --noEmit",
9393
"lint": "eslint .",
9494
"prepare": "husky",
95-
"release": "dotenv -- release-it"
95+
"release": "release-it"
9696
},
9797
"peerDependencies": {
9898
"@fluent/bundle": "*",
@@ -120,7 +120,6 @@
120120
"@vitejs/plugin-vue": "5.2.4",
121121
"@vitest/coverage-istanbul": "^3.1.4",
122122
"@vue/compiler-sfc": "3.5.16",
123-
"dotenv-cli": "8.0.0",
124123
"eslint": "9.28.0",
125124
"execa": "9.6.0",
126125
"husky": "9.1.7",
@@ -137,7 +136,9 @@
137136
},
138137
"lint-staged": {
139138
"*.js": "eslint --fix",
140-
"*.ts?(x)": "eslint --fix"
139+
"*.ts?(x)": "eslint --fix",
140+
"*.json": "eslint --fix",
141+
"*.md": "eslint --fix"
141142
},
142143
"changelog": {
143144
"labels": {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy