-
Notifications
You must be signed in to change notification settings - Fork 0
175 lines (153 loc) · 5.34 KB
/
Copy pathprecompile.yml
File metadata and controls
175 lines (153 loc) · 5.34 KB
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
name: Precompile Local Backend
on:
push:
branches:
- release
workflow_dispatch:
jobs:
release_dashboard:
name: Build Convex Dashboard
runs-on: [self-hosted, aws, x64, xlarge]
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Cache pnpm artifacts
uses: runs-on/cache@v4
env:
AWS_REGION: ${{ vars.AWS_REGION }}
RUNS_ON_S3_BUCKET_CACHE: ${{ vars.RUNS_ON_S3_BUCKET_CACHE }}
with:
path: |
npm-packages/common/temp/build-cache
npm-packages/common/temp/pnpm-store
key:
pnpm-cache-${{
hashFiles('npm-packages/common/config/rush/pnpm-lock.yaml') }}-2
restore-keys: pnpm-cache-
- name: Node setup
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Install just
uses: extractions/setup-just@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: NPM install globals
run: npm ci --prefix scripts
- name: Rush install
run: |
just rush install
- name: Build dashboard dependencies
run: |
just rush build -T dashboard-self-hosted
- name: Build dashboard
run: |
cd npm-packages/dashboard-self-hosted && npm run build:export
- name: Zip output
run: |
cd npm-packages/dashboard-self-hosted/out && zip -r ../../../dashboard.zip .
- name: Precompute release name
id: release_name
shell: bash
run: |
echo "RELEASE_NAME=$(date +'%Y-%m-%d')-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Create Upload Precompiled Artifacts
id: create_release
uses: softprops/action-gh-release@v2
with:
files: |
dashboard.zip
tag_name: precompiled-${{ steps.release_name.outputs.RELEASE_NAME }}
name: Precompiled ${{ steps.release_name.outputs.RELEASE_NAME }}
draft: false
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release_backend:
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: "['self-hosted', 'aws', 'x64', 'xlarge']"
- target: x86_64-apple-darwin
# large are on intel
os: "'macos-latest-large'"
- target: aarch64-apple-darwin
# xlarge are on arm
os: "'macos-latest-xlarge'"
- target: x86_64-pc-windows-msvc
os: "'windows-latest'"
- target: aarch64-unknown-linux-gnu
os: "['self-hosted', 'aws', 'arm64', 'xlarge']"
name: Build Convex Backend
runs-on: ${{ fromJSON(matrix.os) }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
r2-access-key: ${{ secrets.R2_ACCESS_KEY_ID }}
r2-secret-key: ${{ secrets.R2_SECRET_ACCESS_KEY }}
- name: Cache pnpm artifacts
uses: runs-on/cache@v4
env:
AWS_REGION: ${{ vars.AWS_REGION }}
RUNS_ON_S3_BUCKET_CACHE: ${{ vars.RUNS_ON_S3_BUCKET_CACHE }}
with:
path: |
npm-packages/common/temp/build-cache
npm-packages/common/temp/pnpm-store
key:
pnpm-cache-${{
hashFiles('npm-packages/common/config/rush/pnpm-lock.yaml') }}-2
restore-keys: pnpm-cache-
- name: Node setup
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: NPM install globals
run: npm ci --prefix scripts
- name: Install JS
run: |
just rush install
- name: Precompute release name
id: release_name
shell: bash
run: |
echo "RELEASE_NAME=$(date +'%Y-%m-%d')-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
ZIP_NAME=convex-local-backend-${{ matrix.target }}.zip
BINARY_NAME=convex-local-backend${{ runner.os == 'Windows' && '.exe' || '' }}
echo "ZIP_NAME=$ZIP_NAME" >> $GITHUB_OUTPUT
echo "BINARY_NAME=$BINARY_NAME" >> $GITHUB_OUTPUT
- name: Build backend
shell: bash
run: |
set -ex
unset ROCKSDB_LIB_DIR
unset SODIUM_USE_PKG_CONFIG
unset SNAPPY_LIB_DIR
export AWS_LC_SYS_PREBUILT_NASM=1
cargo build --release -p local_backend --bin convex-local-backend
mv target/release/${{ steps.release_name.outputs.BINARY_NAME }} .
- name: Zip backend into arch
uses: thedoctor0/zip-release@0.7.5
with:
type: zip
filename: ${{ steps.release_name.outputs.ZIP_NAME }}
path: ${{ steps.release_name.outputs.BINARY_NAME }}
- name: Create Upload Precompiled Artifacts
id: create_release
uses: softprops/action-gh-release@v2
with:
files: |
${{ steps.release_name.outputs.ZIP_NAME }}
LICENSE.md
tag_name: precompiled-${{ steps.release_name.outputs.RELEASE_NAME }}
name: Precompiled ${{ steps.release_name.outputs.RELEASE_NAME }}
draft: false
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}