Skip to content

fix 4

fix 4 #3

Workflow file for this run

name: CI
on:
push:
branches:
- "ci"
tags:
- "v*"
jobs:
build:
strategy:
matrix:
include:
- os: windows-latest
platform: win32
arch: x64
npm_config_arch: x64
rust_target: x86_64-pc-windows-gnu
- os: ubuntu-latest
platform: linux
arch: x64
npm_config_arch: x64
rust_target: x86_64-unknown-linux-gnu
- os: ubuntu-latest
platform: linux
arch: arm64
npm_config_arch: arm64
rust_target: aarch64-unknown-linux-gnu
- os: macos-latest
platform: darwin
arch: x64
npm_config_arch: x64
rust_target: x86_64-apple-darwin
- os: macos-latest
platform: darwin
arch: arm64
npm_config_arch: arm64
rust_target: aarch64-apple-darwin
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 20.17.0
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
override: true
- name: cross build
run: rustup target add ${{ matrix.rust_target }} && cargo build --verbose --release --target=${{ matrix.rust_target }}
- run: npm install
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
npm_config_arch: ${{ matrix.npm_config_arch }}
- name: Move execute file
run: |
npx webpack --mode production --config webpack.config.js
node -e "try {fs.renameSync('target/${process.env.TARGET}/release/jsonui-lsp', 'dist');}catch(err) {}"
node -e "try {fs.renameSync('target/${process.env.TARGET}/release/jsonui-lsp.exe', 'dist');}catch(err) {}"
env:
TARGET: ${{ matrix.rust_target }}
- shell: pwsh
run: echo "target=${{ matrix.platform }}-${{ matrix.arch }}" >> $env:GITHUB_ENV
- run: npx vsce package --target ${{ env.target }}
- uses: actions/upload-artifact@v2
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 }}