This repository was archived by the owner on May 30, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 319
147 lines (127 loc) · 4.17 KB
/
Copy pathplugin_vscode_publish.yml
File metadata and controls
147 lines (127 loc) · 4.17 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Refact VS Code Plugin Publish
on:
workflow_dispatch:
inputs:
stable_release:
description: "Publish stable release version"
default: false
type: boolean
push:
tags:
- "release/v*"
concurrency:
group: plugin-vscode-publish-${{ github.ref_name }}
cancel-in-progress: false
permissions:
contents: write
defaults:
run:
shell: bash
jobs:
engine:
uses: ./.github/workflows/agent_engine_build.yml
gui:
uses: ./.github/workflows/agent_gui_build.yml
publish:
needs: [engine, gui]
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
code-target: win32-x64
- os: windows-latest
target: aarch64-pc-windows-msvc
code-target: win32-arm64
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
code-target: linux-x64
- os: ubuntu-22.04
target: aarch64-unknown-linux-gnu
code-target: linux-arm64
- os: macos-15
target: x86_64-apple-darwin
code-target: darwin-x64
- os: macos-15
target: aarch64-apple-darwin
code-target: darwin-arm64
name: publish (${{ matrix.target }})
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: plugins/vscode
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Download engine artifact
uses: actions/download-artifact@v4
with:
name: dist-${{ matrix.target }}
path: plugins/vscode/assets
- name: Download GUI package
uses: actions/download-artifact@v4
with:
pattern: lts-refact-chat-js-*.tgz
path: plugins/vscode/chat_package
merge-multiple: true
- name: Prepare GUI package
shell: bash
run: |
mkdir -p ./chat_package_fixed
find ./chat_package -name "*.tgz" -type f -exec cp {} ./chat_package_fixed/ \;
ls -la ./chat_package_fixed
- name: Install dependencies and VSCE
shell: bash
run: |
npm ci
npm install ./chat_package_fixed/*.tgz --no-save
npm install -g @vscode/vsce
rm -rf ./chat_package ./chat_package_fixed
- name: Check release tag version
if: startsWith(github.ref, 'refs/tags/release/v')
shell: bash
run: |
TAG_VERSION="${GITHUB_REF_NAME#release/v}"
PACKAGE_VERSION="$(node -p "require('./package.json').version")"
if [[ "$TAG_VERSION" != "$PACKAGE_VERSION" ]]; then
echo "release tag version $TAG_VERSION does not match VS Code package version $PACKAGE_VERSION"
exit 1
fi
- name: Package VS Code extension
shell: bash
run: |
chmod +x ./assets/refact-lsp*
if [[ "${{ github.event_name }}" != "push" && "${{ inputs.stable_release }}" != "true" ]]; then
export PRERELEASE=--pre-release
fi
echo "PRERELEASE=${PRERELEASE}"
vsce package --target ${{ matrix.code-target }} ${PRERELEASE}
- name: Publish VS Code extension
shell: bash
run: |
if [[ "${{ github.event_name }}" != "push" && "${{ inputs.stable_release }}" != "true" ]]; then
export PRERELEASE=--pre-release
fi
echo "PRERELEASE=${PRERELEASE}"
vsce publish --skip-duplicate --pat ${{ secrets.VSCE_PAT }} ${PRERELEASE} --packagePath *.vsix
- name: Upload VS Code package
uses: actions/upload-artifact@v4
with:
name: vscode-plugin-${{ matrix.target }}
path: plugins/vscode/*.vsix
- name: Upload VS Code package to release
if: startsWith(github.ref, 'refs/tags/release/v')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ github.token }}
file: plugins/vscode/*.vsix
tag: ${{ github.ref }}
overwrite: true
file_glob: true