Skip to content

Commit 7fd0170

Browse files
committed
Attempt a release action
Signed-off-by: Rob Stryker <[email protected]> Attempt a release action Signed-off-by: Rob Stryker <[email protected]> Attempt a release action Signed-off-by: Rob Stryker <[email protected]> Attempt a release action Signed-off-by: Rob Stryker <[email protected]> Attempt a release action Signed-off-by: Rob Stryker <[email protected]> Attempt a release action Signed-off-by: Rob Stryker <[email protected]> Attempt a release action Signed-off-by: Rob Stryker <[email protected]>
1 parent 217bc62 commit 7fd0170

File tree

1 file changed

+74
-2
lines changed

1 file changed

+74
-2
lines changed

.github/workflows/gh-actions.yml

Lines changed: 74 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,23 @@ on:
66
pull_request:
77
branches: [master]
88
workflow_dispatch:
9-
9+
inputs:
10+
publishToMarketPlace:
11+
description: 'Publish to VS Code Marketplace ?'
12+
required: true
13+
type: choice
14+
options:
15+
- 'true'
16+
- 'false'
17+
default: 'false'
18+
publishToOVSX:
19+
description: 'Publish to OpenVSX Registry ?'
20+
required: true
21+
type: choice
22+
options:
23+
- 'true'
24+
- 'false'
25+
default: 'false'
1026
jobs:
1127
test:
1228
runs-on: ${{ matrix.os }} # runs a test on Ubuntu, Windows and macOS
@@ -59,4 +75,60 @@ jobs:
5975
uses: codecov/codecov-action@v4
6076
with:
6177
file: ./coverage/coverage-final.json
62-
78+
79+
packaging-job:
80+
runs-on: ubuntu-latest
81+
if: ${{ github.event_name != 'schedule' }}
82+
steps:
83+
- name: Checkout vscode-server-connector
84+
uses: actions/checkout@v4
85+
- name: Set Up NodeJS
86+
uses: actions/setup-node@v4
87+
with:
88+
node-version: '18'
89+
- name: Install NodeJS dependencies
90+
run: npm install -g typescript "@vscode/vsce" "ovsx"
91+
- name: Cache Version
92+
run: |
93+
echo "EXT_VERSION=$(cat package.json | jq -r .version)" >> $GITHUB_ENV
94+
- name: Build vscode-server-connector
95+
run: |
96+
npm install
97+
npm run build
98+
- name: Package vscode-server-connector
99+
run: |
100+
vsce package -o vscode-server-connector-{{ env.EXT_VERSION }}.vsix
101+
ls -lash *.vsix
102+
- name: Upload VSIX Artifacts
103+
uses: actions/upload-artifact@v4
104+
with:
105+
name: vscode-server-connector
106+
path: |
107+
*.vsix
108+
if-no-files-found: error
109+
release-job:
110+
environment: ${{ (inputs.publishToMarketPlace == 'true' || inputs.publishToOVSX == 'true') && 'release' }}
111+
runs-on: ubuntu-latest
112+
needs: packaging-job
113+
steps:
114+
- name: Set Up NodeJS
115+
uses: actions/setup-node@v4
116+
with:
117+
node-version: '18'
118+
- name: Install dependencies
119+
run: |
120+
npm install -g typescript "@vscode/vsce" "ovsx"
121+
- name: Download VSIX
122+
uses: actions/download-artifact@v4
123+
- name: Publish to VS Code Marketplace
124+
if: ${{ inputs.publishToMarketPlace == 'true' }}
125+
run: |
126+
for platformVsix in *.vsix; do
127+
vsce publish --skip-duplicate -p ${{ secrets.VSCODE_MARKETPLACE_TOKEN }} --packagePath ${platformVsix}
128+
done
129+
- name: Publish to OpenVSX Registry
130+
if: ${{ inputs.publishToOVSX == 'true' }}
131+
run: |
132+
for platformVsix in *.vsix; do
133+
ovsx publish --skip-duplicate -p ${{ secrets.OVSX_MARKETPLACE_TOKEN }} --packagePath ${platformVsix}
134+
done

0 commit comments

Comments
 (0)