-
Notifications
You must be signed in to change notification settings - Fork 2
130 lines (108 loc) · 3.54 KB
/
build.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
name: CI
on: [ push, pull_request ]
jobs:
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use OCaml
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: "5.1.1"
- name: Install dependencies
run: opam install . --deps-only --with-test
- name: Test
run: opam exec -- dune runtest
build:
strategy:
fail-fast: false
matrix:
include:
# - name: Windows
# uses: windows-latest
# ocaml:
# ocaml-compiler: ocaml-variants.5.1.1+options,ocaml-option-mingw
# # Copied from https://github.com/ocaml-multicore/eio/blob/main/.github/workflows/main.yml
# opam-depext: false
# opam-repositories: |
# dra27: https://github.com/dra27/opam-repository.git#windows-5.0
# normal: https://github.com/ocaml/opam-repository.git
# input-file: illuaminate.exe
# output-file: illuaminate-windows-x86_64.exe
# dune-flags:
- name: Linux
uses: ubuntu-latest
# We don't use flambda as that ends up much buliker than without.
ocaml:
ocaml-compiler: ocaml-variants.5.1.1+options,ocaml-option-static
input-file: illuaminate
output-file: illuaminate-linux-x86_64
dune-flags: --workspace dune-workspace.release
# - name: macOS
# uses: macos-latest
# ocaml:
# ocaml-compiler: "5.1.1"
# input-file: illuaminate
# output-file: illuaminate-macos-x86_64
# dune-flags:
name: Build ${{ matrix.name }}
runs-on: ${{ matrix.uses }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# This is required to make the static/musl build work. I *believe*, OCaml
# finds the glibc libzstd during ./configure, and then looks for a musl
# version when compiling. Not 100% sure, as I've not been able to reproduce
# this failure locally.
- name: Remove libzstd
run: sudo apt remove libzstd-dev --yes
if: "matrix.name == 'Linux'"
- name: Use OCaml
uses: ocaml/setup-ocaml@v2
with: ${{ matrix.ocaml }}
- name: Install dependencies
run: opam install . --deps-only
- name: Build release
run: |
opam exec -- dune subst
opam exec -- dune build ${{ matrix.dune-flags }} -p illuaminate @install
opam exec -- dune install --prefix=_install
cp _install/bin/${{ matrix.input-file }} ${{ matrix.output-file }}
- name: Publish executable
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.output-file }}
path: ${{ matrix.output-file }}
if-no-files-found: error
retention-days: 1
upload_archives:
name: Upload Archives
runs-on: ubuntu-latest
needs: build
# if: github.ref == 'refs/heads/master'
permissions:
id-token: write
environment:
name: website
# url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Upload
run: node action.js
# - name: Download executable
# uses: actions/download-artifact@v4
# with:
# path: artifacts
# - name: Upload
# run: .github/workflows/deploy.sh 2> /dev/null
# env:
# SSH_KEY: ${{ secrets.SSH_KEY }}
# SSH_USER: ${{ secrets.SSH_USER }}
# SSH_HOST: ${{ secrets.SSH_HOST }}
# SSH_PORT: ${{ secrets.SSH_PORT }}