Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish Platform Specific Extension #905

Merged
merged 14 commits into from
Jan 26, 2022
29 changes: 0 additions & 29 deletions .github/workflows/build.yml

This file was deleted.

84 changes: 69 additions & 15 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,97 @@ name: Publish Preview release
on:
schedule:
# run every day at 00:15 UTC to avoid high load times at the start of every hour
- cron: '15 0 * * *'
- cron: "15 0 * * *"

jobs:
publish:
name: Publish Preview to VS Code Marketplace
runs-on: ubuntu-latest
build:
name: Package
strategy:
matrix:
include:
- vsce_target: win32-x64
ls_target: windows_amd64
platform: win32
arch: x64
npm_config_arch: x64
- vsce_target: win32-ia32
ls_target: windows_386
platform: win32
arch: ia32
npm_config_arch: ia32
- vsce_target: win32-arm64
ls_target: windows_arm64
platform: win32
arch: arm64
npm_config_arch: arm
- vsce_target: linux-x64
ls_target: linux_amd64
platform: linux
arch: x64
npm_config_arch: x64
- vsce_target: linux-arm64
ls_target: linux_arm64
platform: linux
arch: arm64
npm_config_arch: arm64
- vsce_target: linux-armhf
ls_target: linux_arm
platform: linux
arch: armhf
npm_config_arch: arm
- vsce_target: darwin-x64
ls_target: darwin_amd64
platform: darwin
arch: x64
npm_config_arch: x64
- vsce_target: darwin-arm64
ls_target: darwin_arm64
platform: darwin
arch: arm64
npm_config_arch: arm64
runs-on: "ubuntu-latest"
steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Set preview in package.json
id: set-preview
run: |
./build/preview

- name: Read extension version
id: ext-version
run: |
content=`cat ./package.json | jq -r .version`
echo "::set-output name=content::$content"

- uses: actions/setup-node@v2
with:
node-version-file: '.nvmrc'

node-version-file: ".nvmrc"
- name: Install dependencies
run: npm ci

- name: vsce package
run: npx -- vsce package --out=${{ runner.temp }}/terraform-${{ steps.ext-version.outputs.content }}.vsix

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 }}
path: "*.vsix"
- name: Check latest published version
shell: bash
run: |
export EXTENSION_ID=`cat package.json | jq -r '.publisher + "." + .name'`
npx -- vsce show --json $EXTENSION_ID | jq '.versions[0]'

- name: vsce publish
run: npx -- vsce publish --no-git-tag-version --packagePath=${{ runner.temp }}/terraform-${{ steps.ext-version.outputs.content }}.vsix
publish:
name: Publish All
runs-on: ubuntu-latest
needs: build
if: success() && startsWith( github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v2
- name: Publish Preview Extension
run: npx vsce publish --no-git-tag-version --packagePath $(find . -iname *.vsix)
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
77 changes: 64 additions & 13 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,52 @@ on:
- 'v[0-9]+.[0-9]+.[0-9]+*'

jobs:
publish:
name: Publish to VS Code Marketplace
runs-on: ubuntu-latest
build:
name: Package
strategy:
matrix:
include:
- vsce_target: win32-x64
ls_target: windows_amd64
platform: win32
arch: x64
npm_config_arch: x64
- vsce_target: win32-ia32
ls_target: windows_386
platform: win32
arch: ia32
npm_config_arch: ia32
- vsce_target: win32-arm64
ls_target: windows_arm64
platform: win32
arch: arm64
npm_config_arch: arm
- vsce_target: linux-x64
ls_target: linux_amd64
platform: linux
arch: x64
npm_config_arch: x64
- vsce_target: linux-arm64
ls_target: linux_arm64
platform: linux
arch: arm64
npm_config_arch: arm64
- vsce_target: linux-armhf
ls_target: linux_arm
platform: linux
arch: armhf
npm_config_arch: arm
- vsce_target: darwin-x64
ls_target: darwin_amd64
platform: darwin
arch: x64
npm_config_arch: x64
- vsce_target: darwin-arm64
ls_target: darwin_arm64
platform: darwin
arch: arm64
npm_config_arch: arm64
runs-on: "ubuntu-latest"
steps:
- name: Check out repository
uses: actions/checkout@v2
Expand All @@ -29,18 +72,26 @@ jobs:
node-version-file: '.nvmrc'
- name: Install dependencies
run: npm ci
- name: vsce package
run: npx -- vsce package --out=${{ runner.temp }}/terraform-${{ steps.ext-version.outputs.content }}.vsix
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: terraform-${{ steps.ext-version.outputs.content }}
path: ${{ runner.temp }}/terraform-${{ steps.ext-version.outputs.content }}.vsix
- name: Check latest published version
run: |
export EXTENSION_ID=`cat package.json | jq -r '.publisher + "." + .name'`
npx -- vsce show --json $EXTENSION_ID | jq '.versions[0]'
- name: vsce publish
run: npx -- vsce publish --no-git-tag-version --packagePath=${{ runner.temp }}/terraform-${{ steps.ext-version.outputs.content }}.vsix
name: ${{ matrix.vsce_target }}
path: "*.vsix"

publish:
name: Publish All
runs-on: ubuntu-latest
needs: build
if: success() && startsWith( github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v2
- name: Publish Extension
run: npx vsce publish --no-git-tag-version --packagePath $(find . -iname *.vsix)
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
bin/
out/
node_modules/
*.vsix
Expand Down
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
Loading