-
-
Notifications
You must be signed in to change notification settings - Fork 16
68 lines (58 loc) · 2.1 KB
/
release.yml
File metadata and controls
68 lines (58 loc) · 2.1 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
65
66
67
68
name: Create Plugin Release
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: js-engine # Change this to the name of your plugin-id folder
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
attestations: write
steps:
- name: Checkout
uses: actions/checkout@v6
- 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@v2
with:
bun-version: latest
- name: Build
id: build
run: |
bun install
bun run build
mkdir ${{ env.PLUGIN_NAME }}
cp dist/main.js dist/manifest.json dist/styles.css ${{ env.PLUGIN_NAME }}
zip -r ${{ env.PLUGIN_NAME }}-${{ github.ref_name }}.zip ${{ env.PLUGIN_NAME }}
ls
- name: Attest build provenance
uses: actions/attest@v4
with:
subject-path: |
dist/main.js
dist/manifest.json
dist/styles.css
${{ env.PLUGIN_NAME }}-${{ github.ref_name }}.zip
- name: Release
id: release
uses: softprops/action-gh-release@v3
with:
prerelease: ${{ steps.status.outputs.prerelease }}
token: ${{ secrets.GITHUB_TOKEN }}
files: |
${{ env.PLUGIN_NAME }}-${{ github.ref_name }}.zip
dist/main.js
dist/manifest.json
dist/styles.css