Skip to content

Commit 356038c

Browse files
release only on main branch && create artifact
1 parent 16d9e5f commit 356038c

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
push:
88
branches: [ main ]
99
workflow_dispatch:
10+
pull_request:
1011

1112
jobs:
1213
build-release:
@@ -19,27 +20,29 @@ jobs:
1920
node-version: 18.x
2021
- run: yarn
2122
- run: yarn build
22-
- name: After script
23-
id: afterscript
23+
- name: Create tar from built plugin
2424
run: |
25-
ls -la
2625
BUILDFOLDER="build"
2726
MANIFEST=$(find ./$BUILDFOLDER -name plugin-manifest.json)
2827
[ -z $MANIFEST ] && cp plugin-manifest $BUILDFOLDER
29-
30-
3128
MANIFEST="$BUILDFOLDER/plugin-manifest.json"
32-
VERSION=$(jq '.version' $MANIFEST | tr -d '"')
29+
VERSION=$(jq '.version' $MANIFEST)
3330
echo "version=$VERSION"
3431
mkdir -p output
3532
tar -C $BUILDFOLDER -czf output/$VERSION.tar.gz .
3633
ls -la output
3734
echo "version=$VERSION" >> $GITHUB_ENV
35+
- name: Create artifact
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: plugin-package
39+
path: output
3840
- name: Release built plugin
3941
uses: svenstaro/upload-release-action@v2
4042
with:
4143
repo_token: ${{ secrets.GITHUB_TOKEN }}
4244
file: output/*
4345
tag: ${{ env.version }}
4446
overwrite: true
45-
file_glob: true
47+
file_glob: true
48+
if: github.ref == 'refs/heads/main'

0 commit comments

Comments
 (0)