generated from obsidianmd/obsidian-sample-plugin
-
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (56 loc) · 1.87 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Release Obsidian plugin
on:
push:
tags:
- "*"
permissions:
contents: write
issues: write # Release 노트 작성을 위해
pull-requests: write # Release 관련 PR 필요시
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9
run_install: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Cache pnpm modules
id: pnpm-cache # use this to check for `cache-hit` ==> if: steps.pnpm-cache.outputs.cache-hit != 'true'
uses: actions/cache@v4
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install dependencies
if: steps.pnpm-cache.outputs.cache-hit != 'true'
run: pnpm install
- name: Build plugin
run: pnpm run build
continue-on-error: false
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
tag="${GITHUB_REF#refs/tags/}"
git log "$(git describe --tags --abbrev=0)"..HEAD --oneline > release-notes.md
# 파일 존재 확인
files=("manifest.json" "main.js" "styles.css")
for file in "${files[@]}"; do
if [ ! -f "$file" ]; then
echo "Error: 빌드 결과물 '$file'을 찾을 수 없습니다. 빌드 단계가 성공적으로 완료되었는지 확인해주세요."
exit 1
fi
done
gh release create "$tag" \
--title="Release $tag" \
--notes-file="release-notes.md" \
manifest.json main.js styles.css