Skip to content

try build

try build #18

Workflow file for this run

name: Rust
on:
push:
branches:
- main
tags:
- "*"
pull_request:
branches:
- main
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-20.04, target: x86_64-unknown-linux-gnu, platform: linux-x64, cross: general }
- { os: ubuntu-22.04, target: aarch64-unknown-linux-gnu, platform: linux-arm64, cross: no_format }
- { os: ubuntu-20.04, target: x86_64-unknown-linux-musl, platform: linux-musl, cross: cross }
- { os: ubuntu-22.04, target: x86_64-unknown-freebsd, platform: linux-bsd, cross: no_format }
- { os: macos-latest, target: x86_64-apple-darwin, platform: darwin-x64, cross: general }
- { os: macos-latest, target: aarch64-apple-darwin, platform: darwin-arm64, cross: general }
- { os: windows-latest, target: x86_64-pc-windows-msvc, platform: win32-x64, cross: general }
- { os: windows-latest, target: i686-pc-windows-msvc, platform: win32-ia32, cross: general }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Build - General
if: ${{ matrix.cross == 'general' }}
run: |
rustup target add ${{ matrix.target }}
cargo build --release --target ${{ matrix.target }}
- name: Build - cross
if: ${{ matrix.cross == 'cross' }}
run: |
cargo install cross
cross build --release --target ${{ matrix.target }}
- name: Build - no_format
if: ${{ matrix.cross == 'no_format' }}
run: |
cargo install cross
cross build --release --target ${{ matrix.target }} --features no_format
- name: package-unix
if: ${{ matrix.os != 'windows-latest' }}
run: |
cp target/${{ matrix.target }}/release/lua-language-server ${{ github.workspace }}/artifact/
cp resources ${{ github.workspace }}/artifact/ -r
- name: package-windows
if: ${{ matrix.os == 'windows-latest' }}
run: |
powershell -Command "Copy-Item -Path target\${{ matrix.target }}\release\lua-language-server.exe -Destination ${{ github.workspace }}\artifact\"
powershell -Command "Copy-Item -Path resources -Destination ${{ github.workspace }}\artifact\ -Recurse"
- name: Upload
uses: actions/upload-artifact@v3
with:
name: lua-language-server-${{ matrix.platform }}
path: ${{ github.workspace }}/artifact/