-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (65 loc) · 2.04 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
name: 'Release'
on:
workflow_dispatch:
release:
types: created
jobs:
exe:
name: Release executable
runs-on: '${{ matrix.os }}'
steps:
- name: 'Install deps'
run: bash -c '''case "$(uname)" in
(*Linux*) sudo apt update -y && sudo apt-get install -y libev-dev libssl-dev pkg-config; ;;
(*Darwin*) brew install libev openssl pkg-config; ;;
esac'''
- name: 'Checkout code'
uses: actions/checkout@v3
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Cache Rust environment
uses: Swatinem/rust-cache@v1
- id: wasmstore-opam-cache
name: 'OCaml/Opam cache'
uses: actions/cache@v3
with:
key: 'wasmstore-opam-${{ matrix.ocaml-compiler }}-${{ matrix.target }}-${{ matrix.os }}'
path: ~/.opam
- id: wasmstore-dune-cache
name: 'OCaml/Dune cache'
uses: actions/cache@v3
with:
key: wasmstore-dune-${{ matrix.ocaml-compiler }}-${{ matrix.target }}-${{ matrix.os }}-${{ hashFiles('src/**') }}-${{ hashFiles('dune-project') }}
path: _build
- name: 'Use OCaml ${{ matrix.ocaml-compiler }}'
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: '${{ matrix.ocaml-compiler }}'
- run: opam install . --deps-only -y
- name: 'Make release'
run: |
version="${{ github.ref }}"
if [[ "$version" = "refs/heads/main" ]]; then
version="main"
else
version="${version/refs\/tags\/v/}"
fi
opam exec -- make release VERSION=${version} TARGET=${{ matrix.target }}
- name: Upload Artifact to Release
uses: softprops/action-gh-release@v1
with:
files: |
*.tar.gz
*.checksum.txt
strategy:
fail-fast: true
matrix:
ocaml-compiler:
- 5.1
os:
- macos-latest
- ubuntu-latest
target: [x86_64, aarch64]