Skip to content

Commit ae9e66b

Browse files
add build action
1 parent 7568cc3 commit ae9e66b

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/build.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Build & Release
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
push:
8+
branches: [ main ]
9+
workflow_dispatch:
10+
11+
jobs:
12+
build-release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Use Node.js 18.x
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 18.x
20+
- run: yarn
21+
- run: yarn build
22+
- name: After script
23+
id: afterscript
24+
run: |
25+
ls -la
26+
BUILDFOLDER="dist"
27+
MANIFEST=$(find ./$BUILDFOLDER -name plugin-manifest.json)
28+
[ -z $MANIFEST ] && cp plugin-manifest $BUILDFOLDER
29+
30+
31+
MANIFEST="$BUILDFOLDER/plugin-manifest.json"
32+
VERSION=$(jq '.version' $MANIFEST | tr -d '"')
33+
echo "version=$VERSION"
34+
mkdir -p output
35+
tar -C $BUILDFOLDER -czf output/$VERSION.tar.gz .
36+
ls -la output
37+
echo "version=$VERSION" >> $GITHUB_ENV
38+
- name: Release built plugin
39+
uses: svenstaro/upload-release-action@v2
40+
with:
41+
repo_token: ${{ secrets.GITHUB_TOKEN }}
42+
file: output/*
43+
tag: ${{ env.version }}
44+
overwrite: true
45+
file_glob: true

0 commit comments

Comments
 (0)