Skip to content

ci

ci #4558

Workflow file for this run

name: ci
on:
push:
branches: [master]
pull_request:
branches: [master]
# This is to catch new releases of VS Code which could cause the extension to break
schedule:
- cron: 0 0 * * *
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
vscode-version: ["1.66.0", stable]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup Volta, Node and NPM
uses: volta-cli/action@v4
- run: npm ci
env:
npm_config_arch: x64
- name: Test with VS Code ${{ matrix.vscode-version }}
uses: GabrielBB/xvfb-action@v1
env:
VSCODE_TEST_VERSION: ${{ matrix.vscode-version }}
with:
run: npm test
build:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
target: win32-x64
npm_config_arch: x64
- os: windows-latest
target: win32-arm64
npm_config_arch: arm
- os: ubuntu-latest
target: linux-x64
npm_config_arch: x64
- os: ubuntu-latest
target: linux-arm64
npm_config_arch: arm64
- os: ubuntu-latest
target: linux-armhf
npm_config_arch: arm
- os: ubuntu-latest
target: alpine-x64
npm_config_arch: x64
- os: macos-latest
target: darwin-x64
npm_config_arch: x64
- os: macos-latest
target: darwin-arm64
npm_config_arch: arm64
- os: ubuntu-latest
target: universal
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup Volta, Node and NPM
uses: volta-cli/action@v4
- if: matrix.target != 'universal'
name: Install dependencies (with binaries)
run: npm ci
env:
npm_config_arch: ${{ matrix.npm_config_arch }}
- if: matrix.target == 'universal'
name: Install dependencies (without binaries)
run: npm ci
env:
BINDL_SKIP: "true"
- run: npx semantic-release --extends ./package.release.config.js
env:
VSCE_TARGET: ${{ matrix.target }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VSCE_PAT: ${{ secrets.VSCE_PAT }}
OVSX_PAT: ${{ secrets.OVSX_PAT }}
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}
path: "*.vsix"
release:
if: github.event_name != 'schedule'
needs: [test, build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN_SEMANTIC_RELEASE || github.token }}
- name: Setup Volta, Node and NPM
uses: volta-cli/action@v4
- run: npm ci
env:
BINDL_SKIP: "true"
- uses: actions/download-artifact@v4
with:
merge-multiple: true
# Only run on push events or pull requests coming from the same repository, except from dependabot
- run: npx semantic-release --extends ./publish.release.config.js
if: github.event_name == 'push' || github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VSCE_PAT: ${{ secrets.VSCE_PAT }}
OVSX_PAT: ${{ secrets.OVSX_PAT }}