Skip to content

Commit 5ac1dc8

Browse files
committed
build and attach plugin to releases
1 parent bccb9db commit 5ac1dc8

1 file changed

Lines changed: 31 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ jobs:
1515

1616
steps:
1717
- name: Check out repository history
18-
uses: actions/checkout@v4
18+
uses: actions/checkout@v5
1919
with:
2020
fetch-depth: 0
21+
lfs: true
2122

2223
- name: Check whether the tag is on main
2324
id: tag-check
@@ -35,9 +36,37 @@ jobs:
3536
echo "Tag $TAG_NAME does not point to a commit on main; skipping release."
3637
fi
3738
39+
- name: Set up Java 17
40+
if: steps.tag-check.outputs.on_mainline == 'true'
41+
uses: actions/setup-java@v5
42+
with:
43+
distribution: temurin
44+
java-version: "17"
45+
cache: gradle
46+
47+
- name: Set up Node.js
48+
if: steps.tag-check.outputs.on_mainline == 'true'
49+
uses: actions/setup-node@v6
50+
with:
51+
node-version: "22"
52+
cache: npm
53+
cache-dependency-path: extension_host/package-lock.json
54+
55+
- name: Build release extension
56+
if: steps.tag-check.outputs.on_mainline == 'true'
57+
run: ./scripts/build.sh --mode release --clean
58+
3859
- name: Create GitHub release
3960
if: steps.tag-check.outputs.on_mainline == 'true'
4061
env:
4162
GH_TOKEN: ${{ github.token }}
4263
TAG_NAME: ${{ github.ref_name }}
43-
run: gh release create "$TAG_NAME" --verify-tag --generate-notes --title "$TAG_NAME"
64+
run: |
65+
if ! gh release view "$TAG_NAME" >/dev/null 2>&1; then
66+
gh release create "$TAG_NAME" \
67+
--verify-tag \
68+
--generate-notes \
69+
--title "$TAG_NAME"
70+
fi
71+
72+
gh release upload "$TAG_NAME" dist/ZooCode-*.zip --clobber

0 commit comments

Comments
 (0)