-
Notifications
You must be signed in to change notification settings - Fork 19
181 lines (154 loc) · 5.14 KB
/
evil-build-tag.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
name: "evil-helix - build tag"
on:
push:
tags:
- "release-*"
permissions: write-all
env:
RUST_BACKTRACE: 1
RUST_BUILD_PROFILE: opt
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: aarch64-unknown-linux-gnu
name: aarch64-linux
native: false
os: ubuntu-latest
- id: aarch64-unknown-linux-musl
name: aarch64-linux-musl
native: false
os: ubuntu-latest
- id: arm-unknown-linux-musleabihf
name: armv6-linux-musl
native: false
os: ubuntu-latest
- id: x86_64-apple-darwin
name: amd64-macos
native: true
os: macos-latest
- id: aarch64-apple-darwin
name: aarch64-macos
native: true
os: macos-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"
uses: actions/upload-artifact@v4
with:
name: "evil-helix-${{ matrix.target.name }}"
path: "dist/evil-helix-${{ matrix.target.name }}.*"
release:
needs: [build]
runs-on: ubuntu-latest
steps:
- name: "Prepare"
run: mkdir -p dist
- uses: actions/download-artifact@v4
with:
name: "evil-helix-amd64-linux"
path: "dist/evil-helix-amd64-linux.zip"
- uses: actions/download-artifact@v4
with:
name: "evil-helix-aarch64-linux"
path: "dist/evil-helix-aarch64-linux.zip"
- uses: actions/download-artifact@v4
with:
name: "evil-helix-aarch64-linux-musl"
path: "dist/evil-helix-aarch64-linux-musl.zip"
- uses: actions/download-artifact@v4
with:
name: "evil-helix-armv6-linux-musl"
path: "dist/evil-helix-armv6-linux-musl.zip"
- uses: actions/download-artifact@v4
with:
name: "evil-helix-amd64-macos"
path: "dist/evil-helix-amd64-macos.zip"
- uses: actions/download-artifact@v4
with:
name: "evil-helix-aarch64-macos"
path: "dist/evil-helix-aarch64-macos.zip"
- uses: actions/download-artifact@v4
with:
name: "evil-helix-amd64-windows"
path: "dist/evil-helix-amd64-windows.zip"
- name: "Release suffix"
id: release-suffix
run: echo "::set-output name=suffix::$(date +'%Y%m%d')"
- name: "Create release"
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/evil-helix-*.*
file_glob: true
tag: ${{ github.ref }}
release_name: evil-helix-${{steps.release-suffix.outputs.suffix}}
overwrite: true
draft: true