-
Notifications
You must be signed in to change notification settings - Fork 19
97 lines (78 loc) · 2.54 KB
/
evil-build-pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
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
run: |
rustup target add ${{ matrix.target.id }}
cargo build --target ${{ matrix.target.id }} --profile $BUILD_PROFILE
if: ${{ matrix.target.native}}
- name: Build (cross)
run: cross build --target ${{ matrix.target.id }} --profile $BUILD_PROFILE
if: ${{ !matrix.target.native}}
- name: "Prepare dist"
shell: bash
run: |
mkdir -pv dist/helix
if [ -f target/${{ matrix.target.id }}/$BUILD_PROFILE/hx ]; then
mv -v target/${{ matrix.target.id }}/$BUILD_PROFILE/hx dist/helix/
else
mv -v target/${{ matrix.target.id }}/$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: "Upload artifacts (tar)"
uses: actions/upload-artifact@v4
with:
name: "evil-helix-${{ matrix.target.name }}"
path: "dist/evil-helix-${{ matrix.target.name }}.tar.gz"
- name: "Upload artifacts (zip)"
uses: actions/upload-artifact@v4
with:
name: "evil-helix-${{ matrix.target.name }}"
path: "dist/helix"