-
Notifications
You must be signed in to change notification settings - Fork 8
83 lines (76 loc) · 2.65 KB
/
release.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
name: Prepare Releases
on:
push:
tags:
- "v*.*.*"
jobs:
release:
name: release ${{ matrix.platform.os-name }}
strategy:
fail-fast: false
matrix:
platform:
- os-name: linux-x86_64
runs-on: ubuntu-22.04
target: x86_64-unknown-linux-gnu
- os-name: linux-aarch64
runs-on: ubuntu-22.04
target: aarch64-unknown-linux-gnu
- os-name: windows-msvc
runs-on: windows-latest
target: x86_64-pc-windows-msvc
- os-name: macOS-x86_64
runs-on: macOS-latest
target: x86_64-apple-darwin
- os-name: macOS-aarch64
runs-on: macOS-latest
target: aarch64-apple-darwin
runs-on: ${{ matrix.platform.runs-on }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Build release binary
uses: houseabsolute/actions-rust-cross@v1
with:
command: "build"
toolchain: "nightly"
target: ${{ matrix.platform.target }}
args: "--locked --release --bin=nmo --bin=nemo-language-server"
strip: true
- name: Build archive
shell: bash
run: |
name="${{ format('nemo_{0}_{1}', github.ref_name, matrix.platform.target) }}"
mkdir -p "$name"
cp {README.md,LICENSE-APACHE,LICENSE-MIT} "$name"
if [ "${{ matrix.platform.runs-on }}" = "windows-latest" ]; then
cp "target/${{ matrix.platform.target }}/release/nmo.exe" "$name/"
cp "target/${{ matrix.platform.target }}/release/nemo-language-server.exe" "$name/"
asset=$name.zip
7z a "$asset" "$name"
echo ASSET=$asset >> $GITHUB_ENV
else
cp "target/${{ matrix.platform.target }}/release/nmo" "$name/"
cp "target/${{ matrix.platform.target }}/release/nemo-language-server" "$name/"
asset=$name.tar.gz
tar czf "$asset" "$name"
echo ASSET=$asset >> $GITHUB_ENV
fi
if [ "${{ matrix.platform.runs-on }}" = "macOS-latest" ]; then
shasum -a 256 "$asset" > "$asset.sha256sum"
else
sha256sum "$asset" > "$asset.sha256sum"
fi
- name: Create (draft) release
uses: softprops/action-gh-release@v2
with:
name: "Nemo ${{ github.ref_name }}"
fail_on_unmatched_files: false
generate_release_notes: true
make_latest: true
draft: true
files: |
nemo_*.zip
nemo_*.tar.gz
nemo_*.zip.sha256sum
nemo_*.tar.gz.sha256sum