-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9753487
commit cb16442
Showing
3 changed files
with
91 additions
and
44 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,12 +2,54 @@ name: Build and Publish | |
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- os: windows-latest | ||
platform: win32 | ||
arch: x64 | ||
npm_config_arch: x64 | ||
- os: windows-latest | ||
platform: win32 | ||
arch: ia32 | ||
npm_config_arch: ia32 | ||
- os: windows-latest | ||
platform: win32 | ||
arch: arm64 | ||
npm_config_arch: arm | ||
- os: ubuntu-latest | ||
platform: linux | ||
arch: x64 | ||
npm_config_arch: x64 | ||
- os: ubuntu-latest | ||
platform: linux | ||
arch: arm64 | ||
npm_config_arch: arm64 | ||
- os: ubuntu-latest | ||
platform: linux | ||
arch: armhf | ||
npm_config_arch: arm | ||
- os: ubuntu-latest | ||
platform: alpine | ||
arch: x64 | ||
npm_config_arch: x64 | ||
- os: macos-latest | ||
platform: darwin | ||
arch: x64 | ||
npm_config_arch: x64 | ||
- os: macos-latest | ||
platform: darwin | ||
arch: arm64 | ||
npm_config_arch: arm64 | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
@@ -22,21 +64,66 @@ jobs: | |
test/project/v7/package-lock.json | ||
- name: Install Node dependencies | ||
run: npm ci | ||
- name: Set target variable | ||
run: echo "target=${{ matrix.platform }}-${{ matrix.arch }}" >> $GITHUB_ENV | ||
- name: Package VSIX | ||
run: npm run package | ||
run: npm run package -- --target ${{ env.target }} | ||
- name: Archive VSIX | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: vsix | ||
name: ${{ env.target }} | ||
path: '*.vsix' | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
- name: Install Node.js | ||
uses: actions/[email protected] | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: 'npm' | ||
cache-dependency-path: | | ||
package-lock.json | ||
test/project/v6/package-lock.json | ||
test/project/v7/package-lock.json | ||
- name: Install Node dependencies | ||
id: install | ||
run: npm ci | ||
- name: Test | ||
if: (success() || failure()) && steps.install.conclusion == 'success' | ||
run: npm run test -- --coverage | ||
- name: Typecheck | ||
if: (success() || failure()) && steps.install.conclusion == 'success' | ||
run: npm run typecheck | ||
- name: Lint | ||
if: (success() || failure()) && steps.install.conclusion == 'success' | ||
run: npm run lint | ||
- name: Format | ||
if: (success() || failure()) && steps.install.conclusion == 'success' | ||
run: npm run format | ||
|
||
publish: | ||
runs-on: ubuntu-latest | ||
needs: [build, test] | ||
if: success() && startsWith(github.ref, 'refs/tags/') | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
- name: Install Node.js | ||
uses: actions/[email protected] | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: 'npm' | ||
cache-dependency-path: | | ||
package-lock.json | ||
test/project/v6/package-lock.json | ||
test/project/v7/package-lock.json | ||
- name: Install Node dependencies | ||
id: install | ||
run: npm ci | ||
- uses: actions/[email protected] | ||
- name: Publish to marketplace | ||
run: npm run deploy | ||
env: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters