-
Notifications
You must be signed in to change notification settings - Fork 3
48 lines (39 loc) · 1.13 KB
/
release.yml
File metadata and controls
48 lines (39 loc) · 1.13 KB
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
name: Release Obsidian plugin
on:
push:
tags:
- "*"
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: "1.1"
- name: Build plugin
run: |
bun install
bun run build
- name: Create release archive
run: |
zip -j cumban.zip data.json manifest.json main.js styles.css
- name: Upload release assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
tag="${GITHUB_REF#refs/tags/}"
# Check if release already exists (created via UI)
if gh release view "$tag" > /dev/null 2>&1; then
# Upload assets to existing release
gh release upload "$tag" main.js manifest.json styles.css cumban.zip --clobber
else
# Create new release with assets
gh release create "$tag" \
--title="$tag" \
--generate-notes \
main.js manifest.json styles.css cumban.zip
fi