Skip to content

Commit cd51534

Browse files
committed
Add GitHub Actions workflow for automated releases and simplify build script
1 parent 4d9923a commit cd51534

2 files changed

Lines changed: 38 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Release Obsidian plugin
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
steps:
14+
- uses: actions/checkout@v6
15+
16+
- name: Use Node.js
17+
uses: actions/setup-node@v6
18+
with:
19+
node-version: "20.x"
20+
cache: "npm"
21+
22+
- name: Build plugin
23+
run: |
24+
npm ci
25+
npm run build
26+
27+
- name: Create release
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
run: |
31+
tag="${GITHUB_REF#refs/tags/}"
32+
33+
gh release create "$tag" \
34+
--title="$tag" \
35+
--generate-notes \
36+
--draft \
37+
main.js manifest.json styles.css

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"type": "module",
77
"scripts": {
88
"dev": "node esbuild.config.mjs",
9-
"build": "prettier --write src/ && tsc -noEmit -skipLibCheck && node esbuild.config.mjs production",
9+
"build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production",
1010
"version": "node version-bump.mjs && git add manifest.json versions.json",
1111
"lint": "eslint .",
1212
"test": "vitest run",

0 commit comments

Comments
 (0)