Skip to content

Commit

Permalink
Revert "revert platform specific (#25)" (#26)
Browse files Browse the repository at this point in the history
* Revert "revert platform specific (#25)"

This reverts commit d02f7c3.

* update downloader filename
  • Loading branch information
ms-henglu authored Mar 16, 2022
1 parent 9b72b91 commit be9bab5
Show file tree
Hide file tree
Showing 24 changed files with 8,981 additions and 845 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Publish release

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'

jobs:
build:
name: Package
strategy:
matrix:
include:
- vsce_target: win32-x64
ls_target: windows_amd64
npm_config_arch: x64
- vsce_target: win32-ia32
ls_target: windows_386
npm_config_arch: ia32
- vsce_target: win32-arm64
ls_target: windows_arm64
npm_config_arch: arm
- vsce_target: linux-x64
ls_target: linux_amd64
npm_config_arch: x64
- vsce_target: linux-arm64
ls_target: linux_arm64
npm_config_arch: arm64
- vsce_target: linux-armhf
ls_target: linux_arm
npm_config_arch: arm
- vsce_target: darwin-x64
ls_target: darwin_amd64
npm_config_arch: x64
- vsce_target: darwin-arm64
ls_target: darwin_arm64
npm_config_arch: arm64
runs-on: "ubuntu-latest"
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Read extension version
id: ext-version
run: |
content=`cat ./package.json | jq -r .version`
echo "::set-output name=content::$content"
- name: Ensure version matches with tag
if: ${{ github.ref != format('refs/tags/v{0}', steps.ext-version.outputs.content) }}
run: |
echo "Version mismatch!"
echo "Received ref: ${{ github.ref }}"
echo "Expected ref: refs/tags/v${{ steps.ext-version.outputs.content }}"
exit 1
- uses: actions/setup-node@v2
with:
node-version-file: '.nvmrc'
- name: Install dependencies
run: npm ci
env:
npm_config_arch: ${{ matrix.npm_config_arch }}
- name: Package VSIX
run: npm run package -- --target=${{ matrix.vsce_target }}
env:
ls_target: ${{ matrix.ls_target }}
- name: Upload vsix as artifact
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.vsce_target }}.vsix
path: "*.vsix"
22 changes: 0 additions & 22 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,6 @@ jobs:
- name: lint
run: npm run lint

unit:
strategy:
fail-fast: false
matrix:
os:
- windows-latest
- macos-latest
- ubuntu-latest
runs-on: ${{ matrix.os }}
timeout-minutes: 3

steps:
- name: Checkout Repo
uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version-file: '.nvmrc'
- name: npm install
run: npm ci
- name: unit test
run: npm run test:unit

test:
strategy:
fail-fast: false
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.15.1
16.13.2
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode", "connor4312.esbuild-problem-matchers"]
}
10 changes: 3 additions & 7 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@
"name": "Launch Client",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}"],
"outFiles": ["${workspaceRoot}/out/**/*.js"],
"preLaunchTask": {
"type": "npm",
"script": "watch"
}
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
"outFiles": ["${workspaceFolder}/out/**/*.js"],
"preLaunchTask": "npm: watch"
},
{
"name": "Run Extension Tests",
Expand Down
18 changes: 10 additions & 8 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@
{
"type": "npm",
"script": "watch",
"problemMatcher": "$tsc-watch",
"group": "build",
"problemMatcher": "$esbuild-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
"label": "npm: watch"
},
{
"type": "npm",
"script": "build",
"group": "build",
"problemMatcher": "$esbuild",
"label": "npm: build"
},
{
"label": "terraformInitAndWatch",
Expand Down
1 change: 1 addition & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.vscode-test
build/
lsp/
node_modules/
src/
**/__mocks__
out/*.test.*
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ We use telemetry to send error reports to our team, so we can respond more effec
See the [CHANGELOG](https://github.com/Azure/azapi-vscode/blob/develop/CHANGELOG.md) for more information.

## Local development
0. Prerequisites: golang >1.16, node 14.X, npm 6.X
0. Prerequisites: golang >1.16, node 16.X, npm 8.X
1. Clone [Terraform AzApi Provider Language Server](https://github.com/Azure/azapi-lsp) to local
2. Run `go install` under project folder
3. Add the following configuration to vscode setting file.
Expand Down
7 changes: 2 additions & 5 deletions build/downloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,21 +112,18 @@ async function run(platform: string, architecture: string) {

// unzip
const fileExtension = os === "windows" ? ".exe" : "";
const versionedName = path.resolve(installPath, `azapi-lsp_${release.version}${fileExtension}`);
const unversionedName = path.resolve(installPath, `azapi-lsp${fileExtension}`);
const binaryName = path.resolve(installPath, `azapi-lsp${fileExtension}`);
const fileReadStream = fs.createReadStream(zipfile);
const unzipPipe = unzip.Extract({ path: installPath });
fileReadStream.pipe(unzipPipe);
await new Promise<void>((resolve, reject) => {
unzipPipe.on('close', () => {
fs.chmodSync(versionedName, '755');
fs.chmodSync(binaryName, '755');
return resolve();
});
fileReadStream.on('error', reject);
});

fs.rename(versionedName, unversionedName, function() {})

fs.rmSync(zipfile, {
recursive: true,
});
Expand Down
Loading

0 comments on commit be9bab5

Please sign in to comment.