Skip to content

Feature/more features #61

Feature/more features

Feature/more features #61

Workflow file for this run

name: "evil-helix - build pr"
on:
pull_request:
workflow_dispatch:
permissions: write-all
env:
RUST_BACKTRACE: 1
RUST_BUILD_PROFILE: release
HELIX_LOG_LEVEL: info
HELIX_DEFAULT_RUNTIME: /opt/helix/runtime
BINSTALL_DISABLE_TELEMETRY: true
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
fail-fast: false
matrix:
target:
- id: x86_64-unknown-linux-gnu
name: amd64-linux
native: true
os: ubuntu-latest
- id: x86_64-pc-windows-msvc
name: amd64-windows
native: true
os: windows-latest
runs-on: ${{ matrix.target.os }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
uses: dtolnay/[email protected]
with:
targets: ${{ matrix.target.id }}
- name: Install binstall
uses: "cargo-bins/[email protected]"
if: ${{ !matrix.target.native }}
- name: "Install cross"
run: "cargo binstall -y cross"
if: ${{ !matrix.target.native }}
- uses: Swatinem/rust-cache@v2
with:
shared-key: "build"
- name: Build
shell: bash
run: |
rustup target add ${{ matrix.target.id }}
cargo build --target ${{ matrix.target.id }} --profile $RUST_BUILD_PROFILE
if: ${{ matrix.target.native }}
- name: Build (cross)
shell: bash
run: cross build --target ${{ matrix.target.id }} --profile $RUST_BUILD_PROFILE
if: ${{ !matrix.target.native }}
- name: "Prepare dist"
shell: bash
run: |
mkdir -pv dist/helix
if [ -f target/${{ matrix.target.id }}/$RUST_BUILD_PROFILE/hx ]; then
mv -v target/${{ matrix.target.id }}/$RUST_BUILD_PROFILE/hx dist/helix/
else
mv -v target/${{ matrix.target.id }}/$RUST_BUILD_PROFILE/hx.exe dist/helix/
fi
rm -rf runtime/grammars/sources
mv -v runtime dist/helix/
#cd dist
#if [[ "$RUNNER_OS" != "Windows" ]]; then
# tar -cvzf "evil-helix-${{ matrix.target.name }}.tar.gz" helix
#fi
- name: "Compress dist (tar)"
shell: bash
run: |
cd dist
tar -cvzf "evil-helix-${{ matrix.target.name }}.tar.gz" helix
if: ${{ matrix.target.id != 'x86_64-pc-windows-msvc' }}
- name: "Compress dist (zip)"
run: |
cd dist
Compress-Archive -Path helix -Destination "evil-helix-${{ matrix.target.name }}.zip"
if: ${{ matrix.target.id == 'x86_64-pc-windows-msvc' }}
- name: "Upload artifacts (tar)"
uses: actions/upload-artifact@v4
with:
name: "evil-helix-${{ matrix.target.name }}"
path: "dist/evil-helix-${{ matrix.target.name }}.tar.gz"
if: ${{ matrix.target.id != 'x86_64-pc-windows-msvc' }}
- name: "Upload artifacts (zip)"
uses: actions/upload-artifact@v4
with:
name: "evil-helix-${{ matrix.target.name }}"
path: "dist/evil-helix-${{ matrix.target.name }}.zip"
if: ${{ matrix.target.id == 'x86_64-pc-windows-msvc' }}