Skip to content

Commit eb4c85f

Browse files
author
ladeak
committed
Builds and README for VSCodeExtension
1 parent 2c8c672 commit eb4c85f

4 files changed

Lines changed: 72 additions & 18 deletions

File tree

.github/workflows/CD.yml

Lines changed: 55 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ jobs:
2121
uses: actions/setup-dotnet@v5
2222
with:
2323
dotnet-version: ${{ env.DOTNET_VERSION }}
24-
- name: Install Node.js
25-
uses: actions/setup-node@v6
26-
with:
27-
node-version: 24.x
2824
- name: Set VERSION variable from tag
2925
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
3026
- name: Trusted Publishing Auth
@@ -50,7 +46,7 @@ jobs:
5046
dotnet nuget push src/CHttp.Api/nupkg/*.nupkg --source https://api.nuget.org/v3/index.json --api-key "${{ steps.trustedpublish.outputs.NUGET_API_KEY }}" --skip-duplicate
5147
dotnet nuget push src/CHttpExecutor/nupkg/*.nupkg --source https://api.nuget.org/v3/index.json --api-key "${{ steps.trustedpublish.outputs.NUGET_API_KEY }}" --skip-duplicate
5248
dotnet nuget push src/CHttpServer/CHttpServer/nupkg/*.nupkg --source https://api.nuget.org/v3/index.json --api-key "${{ steps.trustedpublish.outputs.NUGET_API_KEY }}" --skip-duplicate
53-
- name: Publish for GitHub
49+
- name: Build GitHub packages
5450
run: |
5551
# CHttp
5652
dotnet publish src/CHttp/CHttp.csproj --configuration ${{ env.CONFIGURATION }} --self-contained --runtime win-x64 -p:Version=${VERSION} -p:PublishSingleFile=true -p:PublishTrimmed=true --framework ${{ env.GH_PACKAGE_VERSION }}
@@ -76,13 +72,7 @@ jobs:
7672
mv src/CHttpExecutor/bin/Release/${{ env.GH_PACKAGE_VERSION }}/win-x64/publish/CHttpExecutor.exe src/CHttpExecutor/bin/Release/${{ env.GH_PACKAGE_VERSION }}/win-x64/publish/chttpexec-win-x64.exe
7773
dotnet publish src/CHttpExecutor/CHttpExecutor.csproj --configuration ${{ env.CONFIGURATION }} --self-contained --runtime linux-x64 -p:Version=${VERSION} -p:PublishSingleFile=true -p:PublishTrimmed=true --framework ${{ env.GH_PACKAGE_VERSION }}
7874
mv src/CHttpExecutor/bin/Release/${{ env.GH_PACKAGE_VERSION }}/linux-x64/publish/CHttpExecutor src/CHttpExecutor/bin/Release/${{ env.GH_PACKAGE_VERSION }}/linux-x64/publish/chttpexec-linux-x64
79-
- name: Publish VSCE
80-
run: |
81-
pushd ./src/VSCodeExt/
82-
npm install
83-
npm run vsce-deploy ${VERSION}
84-
popd
85-
- name: Release
75+
- name: Publish to GitHub
8676
uses: softprops/action-gh-release@v3
8777
with:
8878
files: |
@@ -97,9 +87,16 @@ jobs:
9787
src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/linux-arm/publish/chttp-linux-arm
9888
src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/linux-arm/publish/chttp-linux-arm.pdb
9989
src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/linux-x64/publish/chttp-linux-x64-aot
100-
src/VSCodeExt/chttp-vsce.vsix
10190
src/CHttpExecutor/bin/Release/${{ env.GH_PACKAGE_VERSION }}/win-x64/publish/chttpexec-win-x64.exe
10291
src/CHttpExecutor/bin/Release/${{ env.GH_PACKAGE_VERSION }}/linux-x64/publish/chttpexec-linux-x64
92+
- name: Build VSCodeExtension dependencies
93+
run: |
94+
dotnet publish src/CHttpExtension -r win-x64 -f net9.0 # .NET 9
95+
- name: Upload CHttpExtension file to artifacts
96+
uses: actions/upload-artifact@v4
97+
with:
98+
name: CHttpExtension-Linux # The name of the artifact bundle
99+
path: src/CHttpExtension/linux-x64/publish/*
103100

104101
cross-compile-windows-aot:
105102
runs-on: windows-latest
@@ -113,16 +110,59 @@ jobs:
113110
run: |
114111
$ver="${{GITHUB.REF_NAME}}" -replace 'v', ''
115112
echo "VERSION=${ver}" >> $env:GITHUB_ENV
116-
- name: Publish for GitHub
113+
- name: Build GitHub packages
117114
run: |
118115
# CHttp Aot Windows
119116
dotnet publish src/CHttp/CHttp.csproj --configuration ${{ env.CONFIGURATION }} -p:Version=${{ env.VERSION }} -p:PublishAot=true --runtime win-x64 --framework ${{ env.GH_PACKAGE_VERSION }}
120117
mv src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/win-x64/publish/CHttp.exe src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/win-x64/publish/chttp-win-x64-aot.exe
121118
dotnet publish src/CHttp/CHttp.csproj --configuration ${{ env.CONFIGURATION }} -p:Version=${{ env.VERSION }} -p:PublishAot=true --runtime win-arm64 --framework ${{ env.GH_PACKAGE_VERSION }}
122119
mv src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/win-arm64/publish/CHttp.exe src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/win-arm64/publish/chttp-win-arm64-aot.exe
123-
- name: Release
120+
- name: Publish to GitHub
124121
uses: softprops/action-gh-release@v3
125122
with:
126123
files: |
127124
src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/win-x64/publish/chttp-win-x64-aot.exe
128125
src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/win-arm64/publish/chttp-win-arm64-aot.exe
126+
- name: Build VSCodeExtension dependencies
127+
run: |
128+
dotnet publish src/CHttpExtension -r linux-x64 -f net9.0 # .NET 9
129+
- name: Upload CHttpExtension file to artifacts
130+
uses: actions/upload-artifact@v4
131+
with:
132+
name: CHttpExtension-Windows # The name of the artifact bundle
133+
path: src/CHttpExtension/linux-x64/publish/*
134+
135+
build-and-deploy-vscodeextension:
136+
runs-on: ubuntu-latest
137+
needs: [cross-compile-windows-aot, build-and-deploy]
138+
permissions:
139+
contents: write
140+
steps:
141+
- uses: actions/checkout@v6
142+
- name: Install Node.js
143+
uses: actions/setup-node@v6
144+
with:
145+
node-version: 26.x
146+
- name: Set VERSION variable from tag
147+
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
148+
- name: Download Platform Specific Artifacts - Linux
149+
uses: actions/download-artifact@v4
150+
with:
151+
name: CHttpExtension-Linux
152+
path: src/VSCodeExt/src/chttp-linux-x64
153+
- name: Download Platform Specific Artifacts - Windows
154+
uses: actions/download-artifact@v4
155+
with:
156+
name: CHttpExtension-Windows
157+
path: src/VSCodeExt/src/chttp-win32-x64
158+
- name: Publish VSCE
159+
run: |
160+
pushd ./src/VSCodeExt/
161+
npm install
162+
npm run vsce-deploy ${VERSION}
163+
popd
164+
- name: Release
165+
uses: softprops/action-gh-release@v3
166+
with:
167+
files: |
168+
src/VSCodeExt/chttp-vsce.vsix

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,10 @@ Run the following commands to publish the native dependencis of the VS Code Exte
302302
For this use that latest .NET major version:
303303

304304
```$
305-
dotnet publish src/CHttpExtension -r win-x64 -f net10.0
306-
cp ./src/CHttpExtension/bin/Release/net10.0/win-x64/publish/* ./src/VSCodeExt/src/chttp-win-x64
305+
dotnet publish src/CHttpExtension -r win-x64 -f net9.0
306+
cp ./src/CHttpExtension/bin/Release/net9.0/win-x64/publish/* ./src/VSCodeExt/src/chttp-win32-x64
307+
dotnet publish src/CHttpExtension -r linux-x64 -f net9.0
308+
cp ./src/CHttpExtension/bin/Release/net9.0/linux-x64/publish/* ./src/VSCodeExt/src/chttp-linux-x64
307309
```
308310

309311
### Cleanup NPM

src/VSCodeExt/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,3 +214,15 @@ HTTP status codes:
214214
*Warning: session files contain different urls: https://localhost:5001/,https://localhost:5001/post
215215
------------------------------------------------------------------------
216216
```
217+
218+
## Troubleshooting
219+
220+
On Linux, to use HTTP/3, install libmsquic. For example, on Ubuntu:
221+
222+
```
223+
sudo wget https://packages.microsoft.com/config/ubuntu/<version>/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
224+
sudo dpkg -i packages-microsoft-prod.deb
225+
rm packages-microsoft-prod.deb
226+
sudo apt-get update
227+
sudo apt-get install -y libmsquic
228+
```

src/VSCodeExt/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"pretest": "npm run compile-tests && npm run compile && npm run lint",
6868
"lint": "eslint src --ext ts",
6969
"test": "node ./out/test/runTest.js",
70-
"vsce-deploy": "vsce package --out chttp-vsce.vsix --target win32-x64",
70+
"vsce-deploy": "vsce package --out chttp-vsce.vsix --target win32-x64 linux-x64",
7171
"vsce-publish": "vsce publish"
7272
},
7373
"devDependencies": {

0 commit comments

Comments
 (0)