forked from vshymanskyy/ViperIDE
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (53 loc) · 1.83 KB
/
Copy pathrelease.yml
File metadata and controls
56 lines (53 loc) · 1.83 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
# Gate-1 decision: plain vX.Y.Z tags are the release trigger for the app
# (the mcp-v* flow remains, but only for the MCP tool's npm artifact).
# Builds the full app and attaches the deployable bundle to the Release.
name: Release
on:
push:
tags: ['v[0-9]*']
workflow_dispatch:
inputs:
tag:
description: Existing vX.Y.Z tag to (re)release (catch-up)
required: true
type: string
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.tag || github.ref }}
- uses: actions/setup-node@v4
with:
node-version: '24'
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Refuse pre-fork tags
# Every inherited ViperIDE tag (v0.5.x-v0.6.x) predates the fork;
# building one publishes upstream's app under this project's name
# (it happened once - the v0.6.5 catch-up). Workbench releases only.
run: |
NAME=$(node -p "require('./package.json').name")
if [[ "$NAME" != *[Ww]orkbench* ]]; then
echo "::error::Tag checks out '$NAME', not Workbench - refusing to release a pre-fork tree." >&2
exit 1
fi
- name: Build the app
env:
VIPER_IDE_BASE_URL: https://pydevices.github.io/workbench
run: |
npm ci
python3 build.py --skip-tests
- name: Bundle and release
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ inputs.tag || github.ref_name }}
run: |
(cd build && zip -qr "../workbench-$TAG.zip" .)
gh release view "$TAG" >/dev/null 2>&1 || \
gh release create "$TAG" --title "$TAG" --generate-notes
gh release upload "$TAG" "workbench-$TAG.zip" --clobber