-
Notifications
You must be signed in to change notification settings - Fork 366
129 lines (127 loc) · 4 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
name: Setup, Build & Test
on:
workflow_call:
inputs:
os:
required: true
type: string
platform:
required: true
type: string
arch:
required: true
type: string
release:
required: false
type: string
toolchain:
required: false
type: string
default: "nightly"
jobs:
build:
runs-on: ${{ inputs.os }}
name: build ${{ inputs.arch }}-${{ inputs.platform }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout submodules
run: git submodule update --init --checkout
- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: yarn
node-version: lts/*
- name: Install Linux dependencies
if: inputs.platform == 'linux'
run: |
sudo apt-get -y update
sudo apt-get -y install make nodejs
sudo snap install zig --classic --beta
- name: Install MacOS dependencies
if: inputs.platform == 'darwin'
env:
HOMEBREW_NO_AUTO_UPDATE: 1
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install zig make
- name: Install zig on windows
if: inputs.platform == 'windows'
shell: pwsh
run: |
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
iex "& {$(irm get.scoop.sh)} -RunAsAdmin"
scoop install zig
- name: Install Windows dependencies
if: inputs.platform == 'windows'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
path-type: inherit
install: >-
mingw-w64-x86_64-make
mingw-w64-x86_64-cmake
mingw-w64-x86_64-gcc
mingw-w64-x86_64-clang
mingw-w64-x86_64-perl
zip
zstd
patch
unzip
- name: Install JavaScript dependencies
run: |
corepack enable
yarn
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ inputs.toolchain }}
- name: Run tests
if: inputs.platform != 'windows'
run: |
make test-ci 2>&1
- name: Run tests on windows
if: inputs.platform == 'windows'
shell: msys2 {0}
run: |
make test-ci 2>&1
- name: Build Linux binaries
if: inputs.release && inputs.platform == 'linux'
run: |
make libs-${{ inputs.release }}
make release-aws-${{ inputs.release }}
make release-aws-${{ inputs.release }}-no-sdk
make release-aws-${{ inputs.release }}-full-sdk
- name: Build Darwin binaries
if: inputs.release && inputs.platform == 'darwin'
run: |
make llrt-darwin-${{ inputs.release }}.zip
make llrt-darwin-${{ inputs.release }}-no-sdk.zip
make llrt-darwin-${{ inputs.release }}-full-sdk.zip
- name: Build Windows binaries
if: inputs.release && inputs.platform == 'windows'
shell: msys2 {0}
run: |
# HACK: Add scoop/shims to PATH
export PATH="$PATH:/c/Users/$USER/scoop/shims"
make stdlib
make libs-${{ inputs.release }}
make llrt-windows-${{ inputs.release }}.zip
make llrt-windows-${{ inputs.release }}-no-sdk.zip
make llrt-windows-${{ inputs.release }}-full-sdk.zip
- name: Upload artifacts
if: inputs.release
uses: actions/upload-artifact@v4
with:
name: artifacts-${{ inputs.platform }}-${{ inputs.arch }}
path: |
*.zip
llrt-container-arm64*
llrt-container-x64*
- name: Upload changelog
if: inputs.release && inputs.platform == 'linux' && inputs.arch == 'x86_64'
uses: actions/upload-artifact@v4
with:
name: changelog
path: CHANGELOG.md