This repository has been archived by the owner on Nov 5, 2024. It is now read-only.
Full build #27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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,fontconfig,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 }} | |
# Lapce build is platform independent, and since the editor/extensions are | |
# in beta and not well documented, allow this to fail | |
build-lapce: | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: wasm32-wasi | |
- uses: Swatinem/rust-cache@v2 | |
- uses: davidB/[email protected] | |
- name: Build | |
run: cargo make lapce-extension-build-release-flow | |
# It's not clear if `volts` can bundle an extension without uploading it, | |
# so we just send all the files it needs so it can bundle and upload in a | |
# later stage | |
- name: Upload extension files | |
uses: actions/upload-artifact@v3 | |
with: | |
name: lapce | |
path: | | |
editors/lapce/ | |
!editors/lapce/Cargo.* | |
!editors/lapce/src/ | |
!editors/lapce/target/ |