Skip to content

CI

CI #233

Workflow file for this run

name: CI
on:
push:
# branches:
# - "**"
tags:
- "v*.*.*"
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
platform: win32
arch: x64
#- os: windows-latest
# platform: win32
# arch: ia32
#- os: windows-latest
# platform: win32
# arch: arm64
- os: ubuntu-20.04
platform: linux
arch: x64
# - os: ubuntu-latest
# platform: linux
# arch: arm64
# - os: ubuntu-latest
# platform: linux
# arch: armhf
# - os: ubuntu-latest
# platform: alpine
# arch: x64
- os: macos-13
platform: darwin
arch: x64
- os: macos-13-xlarge
platform: darwin
arch: arm64
runs-on: ${{ matrix.os }}
steps:
- shell: pwsh
run: echo "target=${{ matrix.platform }}-${{ matrix.arch }}" >> $env:GITHUB_ENV
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
architecture: ${{ matrix.arch }}
cache: 'npm'
- run: echo '${{ secrets.CONFIG_JSON }}' > ${{ github.workspace }}/src/config.json
- uses: ilammy/setup-nasm@v1
- name: windows-specific
shell: pwsh
if: matrix.platform == 'win32'
run: choco install openssl.light --version=1.1.1 && choco install cmake --global && npm install --global cmake-js node-gyp && echo CMAKE_JS_LIB - $CMAKE_JS_LIB
- name: mac-specific
shell: bash
if: matrix.platform == 'darwin'
run: |
rm -rf /usr/local/bin/cmake
wget https://cmake.org/files/v3.27/cmake-3.27.9-macos-universal.tar.gz
tar xf cmake-3.27.9-macos-universal.tar.gz
WORKING_DIRECTORY=$(pwd)
echo "${WORKING_DIRECTORY}/cmake-3.27.9-macos-universal/CMake.app/Contents/bin" >> $GITHUB_PATH
echo "PATH=${WORKING_DIRECTORY}/cmake-3.27.9-macos-universal/CMake.app/Contents/bin:$PATH" >> $GITHUB_ENV
- name: linux-specific
shell: bash
if: matrix.platform == 'linux'
run: |
ldd --version
rm -rf /usr/local/bin/cmake
wget https://cmake.org/files/v3.27/cmake-3.27.9-linux-x86_64.tar.gz
tar xf cmake-3.27.9-linux-x86_64.tar.gz
WORKING_DIRECTORY=$(pwd)
echo "${WORKING_DIRECTORY}/cmake-3.27.9-linux-x86_64/bin" >> $GITHUB_PATH
echo "PATH=${WORKING_DIRECTORY}/cmake-3.27.9-linux-x86_64/bin:$PATH" >> $GITHUB_ENV
- name: general
run: npm i && npm run rebuild
- run: npx vsce package --target ${{ env.target }}
- uses: actions/upload-artifact@v4
with:
name: ${{ env.target }}
path: "*.vsix"
# publish:
# runs-on: ubuntu-latest
# needs: build
# if: success() && startsWith( github.ref, 'refs/tags/')
# steps:
# - uses: actions/download-artifact@v2
# - run: npx vsce publish --packagePath $(find . -iname *.vsix)
# env:
# VSCE_PAT: ${{ secrets.VSCE_PAT }}