Skip to content

Commit

Permalink
feat(NomicFoundation#534): platform specific builds of vsix
Browse files Browse the repository at this point in the history
  • Loading branch information
gordon-to committed Nov 14, 2024
1 parent ba13b37 commit 0a1daec
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 12 deletions.
47 changes: 41 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,49 @@ on:

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]

include:
- os: windows-latest
platform: win32
arch: x64
npm_config_arch: x64
- 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: Clone repository
uses: actions/checkout@v4

- shell: pwsh
run: echo "TARGET=${{ matrix.platform }}-${{ matrix.arch }}" >> $env:GITHUB_ENV

- name: Setup Node
uses: actions/setup-node@v4
Expand All @@ -32,11 +65,13 @@ jobs:
cache-name: cache-node-modules
with:
path: "**/node_modules"
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package.json', '**/package-lock.json') }}
key: ${{ runner.os }}-${{ matrix.npm_config_arch }}-node-modules-${{ hashFiles('**/package.json', '**/package-lock.json') }}

- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci
env:
npm_config_arch: ${{ matrix.npm_config_arch }}

- name: Lint
run: npm run lint
Expand All @@ -53,7 +88,7 @@ jobs:
run: npm run build

- name: Run server tests
run: npm run test:codecov
run: npm run test

- name: Run protocol tests
run: npm run test:protocol
Expand Down
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"prettier": "prettier *.json \"src/**/*.{ts,js,md,json,yml}\"",
"clean": "rimraf out tmp tsconfig.tsbuildinfo",
"prepackage": "npm run clean && node scripts/bundle.js",
"package": "cd ./tmp && vsce package --no-dependencies --no-yarn -o ..",
"package": "cd ./tmp && vsce package --no-dependencies --no-yarn --target $TARGET -o ..",
"postpackage": "rimraf ./tmp"
},
"devDependencies": {
Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0a1daec

Please sign in to comment.