File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed
Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build & Release
2+
3+ permissions :
4+ contents : write
5+
6+ on :
7+ push :
8+ branches : [ main ]
9+ workflow_dispatch :
10+ pull_request :
11+
12+ jobs :
13+ build-release :
14+ runs-on : ubuntu-latest
15+ steps :
16+ - uses : actions/checkout@v4
17+ - name : Use Node.js 18.x
18+ uses : actions/setup-node@v4
19+ with :
20+ node-version : 18.x
21+ - run : yarn
22+ - run : yarn build
23+ - name : Create tar from built plugin
24+ run : |
25+ BUILDFOLDER="build"
26+ MANIFEST=$(find ./$BUILDFOLDER -name plugin-manifest.json)
27+ [ -z $MANIFEST ] && cp plugin-manifest $BUILDFOLDER
28+ MANIFEST="$BUILDFOLDER/plugin-manifest.json"
29+ VERSION=$(jq '.version' $MANIFEST -r)
30+ echo "version=$VERSION"
31+ mkdir -p output
32+ tar -C $BUILDFOLDER -czf output/$VERSION.tar.gz .
33+ ls -la output
34+ echo "version=$VERSION" >> $GITHUB_ENV
35+ - name : Create artifact
36+ uses : actions/upload-artifact@v4
37+ with :
38+ name : plugin-package
39+ path : output
40+ - name : Release built plugin
41+ uses : svenstaro/upload-release-action@v2
42+ with :
43+ repo_token : ${{ secrets.GITHUB_TOKEN }}
44+ file : output/*
45+ tag : ${{ env.version }}
46+ overwrite : true
47+ file_glob : true
48+ if : github.ref == 'refs/heads/main'
You can’t perform that action at this time.
0 commit comments