Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Full build

Full build #18

Workflow file for this run

name: Full build
on:
workflow_call:
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
rust-target: x86_64-pc-windows-msvc
vs-code-target: win32-x64
features:
# Ring fails to compile on this target, so don't use rustls
- os: windows-latest
rust-target: aarch64-pc-windows-msvc
vs-code-target: win32-arm64
features: --no-default-features -F remote-packages,native-tls
- os: ubuntu-20.04
rust-target: x86_64-unknown-linux-gnu
vs-code-target: linux-x64
features:
- os: ubuntu-20.04
rust-target: aarch64-unknown-linux-gnu
vs-code-target: linux-arm64
features:
- os: ubuntu-20.04
rust-target: x86_64-unknown-linux-musl
vs-code-target: alpine-x64
features:
- os: ubuntu-20.04
rust-target: arm-unknown-linux-gnueabihf
vs-code-target: linux-armhf
features:
- os: macos-latest
rust-target: x86_64-apple-darwin
vs-code-target: darwin-x64
features:
- os: macos-latest
rust-target: aarch64-apple-darwin
vs-code-target: darwin-arm64
features:
name: ${{ matrix.rust-target }}
runs-on: ${{ matrix.os }}
env:
BIN_EXT: ${{ fromJSON('["", ".exe"]')[matrix.os == 'windows-latest'] }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- uses: Swatinem/rust-cache@v2
- run: npm install
working-directory: ./editors/vscode
- name: Musl tool install
if: ${{ matrix.rust-target == 'x86_64-unknown-linux-musl' }}
run: |
sudo apt-get update
sudo apt-get install musl-tools
- name: Build Rust
uses: houseabsolute/actions-rust-cross@v0
with:
command: build
target: ${{ matrix.rust-target }}
args: "--release --locked ${{ matrix.features }}"
- name: Move binaries
run: |
mkdir -p editors/vscode/out
cp "target/${{ matrix.rust-target }}/release/typst-lsp${{ env.BIN_EXT }}" editors/vscode/out/
cp "target/${{ matrix.rust-target }}/release/typst-lsp${{ env.BIN_EXT }}" "typst-lsp-${{ matrix.rust-target }}${{ env.BIN_EXT }}"
- name: Package VS Code extension
shell: bash
run: npm run package -- --target ${{ matrix.vs-code-target }} -o typst-lsp-${{ matrix.vs-code-target }}.vsix
working-directory: ./editors/vscode
- name: Upload VS Code extension
uses: actions/upload-artifact@v3
with:
name: typst-lsp-${{ matrix.vs-code-target }}.vsix
path: editors/vscode/typst-lsp-${{ matrix.vs-code-target }}.vsix
- name: Upload binary
uses: actions/upload-artifact@v3
with:
name: typst-lsp-${{ matrix.vs-code-target }}
path: typst-lsp-${{ matrix.rust-target }}${{ env.BIN_EXT }}