generated from obsidianmd/obsidian-sample-plugin
-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (47 loc) · 1.77 KB
/
release.yml
File metadata and controls
56 lines (47 loc) · 1.77 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
49
50
51
52
53
54
55
56
name: Build Obsidian Plugin
# adapted from https://github.com/argenos/nldates-obsidian/blob/master/.github/workflows/release.yml
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- '*' # Push events to matching any tag format, i.e. 1.0, 20.15.10
env:
PLUGIN_NAME: lemons-plugin-template # Change this to the name of your plugin-id folder
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Determine prerelease status
id: status
run: |
if [[ "${{ github.ref }}" == *"canary"* ]]; then
echo "prerelease=true" >> $GITHUB_OUTPUT
else
echo "prerelease=false" >> $GITHUB_OUTPUT
fi
- name: Install Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Build
id: build
run: |
bun install
bun run build
mkdir ${{ env.PLUGIN_NAME }}
cp main.js manifest.json styles.css ${{ env.PLUGIN_NAME }}
zip -r ${{ env.PLUGIN_NAME }}-${{ github.ref_name }}.zip ${{ env.PLUGIN_NAME }}
ls
- name: Release
id: release
uses: softprops/action-gh-release@v2
with:
prerelease: ${{ steps.status.outputs.prerelease }}
token: ${{ secrets.GITHUB_TOKEN }}
files: |
${{ env.PLUGIN_NAME }}-${{ github.ref_name }}.zip
main.js
manifest.json
styles.css