-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (53 loc) · 1.55 KB
/
release.yaml
File metadata and controls
64 lines (53 loc) · 1.55 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
57
58
59
60
61
62
63
64
name: Release Obsidian plugin
env:
PLUGIN_NAME: better-embedded-canvas
PLUGIN_VERSION: ${GITHUB_REF#refs/tags/}
on:
push:
tags:
- "*"
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
attestations: write
artifact-metadata: write
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "24.x"
- name: Build plugin
run: |
npm install
npm run build
npm run build:styles
- name: Create changelog
run: |
npm run changelog
- name: Create zip archive
run: |
cd dist
mkdir ${{ env.PLUGIN_NAME }}
cp ../manifest.json .
cp main.js manifest.json styles.css ${{ env.PLUGIN_NAME }}
zip -r -9 ${{ env.PLUGIN_NAME }}-${{ env.PLUGIN_VERSION }}.zip ${{ env.PLUGIN_NAME }}
- name: Attest build provenance
uses: actions/attest@v4
with:
subject-path: |
dist/main.js
dist/style.css
dist/manifest.json
"dist/${{ env.PLUGIN_NAME }}-${{ env.PLUGIN_VERSION }}.zip"
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd dist
gh release create "${{ env.PLUGIN_VERSION }}" \
--title="${{ env.PLUGIN_VERSION }}" \
--notes-file=../CHANGELOG.md \
main.js manifest.json styles.css ${{ env.PLUGIN_NAME }}-${{ env.PLUGIN_VERSION }}.zip