-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (51 loc) · 1.33 KB
/
Copy pathrelease.yml
File metadata and controls
62 lines (51 loc) · 1.33 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
name: Build and Release Obsidian Plugin
on:
push:
branches:
- main
tags:
- '[0-9]*'
pull_request:
branches:
- main
jobs:
release:
name: Build & Release
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
attestations: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '22'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run lint checks
run: npm run lint
- name: Run tests
run: npm run test
- name: Build plugin
run: npm run build
- name: Generate Release
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{ github.ref_name }} main.js manifest.json styles.css \
--title "${{ github.ref_name }}" \
--notes "Release ${{ github.ref_name }}" \
--draft=false \
--prerelease=false
- name: Attest Build Provenance
if: startsWith(github.ref, 'refs/tags/')
uses: actions/attest-build-provenance@v2
with:
subject-path: |
main.js
styles.css