forked from skozin/node-fdb
-
Notifications
You must be signed in to change notification settings - Fork 18
146 lines (117 loc) · 4.51 KB
/
buildmod.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: deploy
on:
release:
types: [created]
workflow_dispatch:
inputs:
# version:
# description: 'Name of version (ie 5.5.0)'
# required: true
jobs:
prebuild-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup nodejs
uses: actions/setup-node@v2
with:
node-version: 18
- run: wget -nv "https://github.com/apple/foundationdb/releases/download/7.2.5/foundationdb-clients_7.2.5-1_amd64.deb"
- run: sudo dpkg -i foundationdb-clients_7.2.5-1_amd64.deb
- run: sudo mkdir -p /var/lib/foundationdb/data
- run: wget -nv "https://github.com/apple/foundationdb/releases/download/7.2.5/foundationdb-server_7.2.5-1_amd64.deb"
- run: sudo dpkg -i foundationdb-server_7.2.5-1_amd64.deb
- run: yarn
- run: yarn prebuild
- run: yarn test
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: linux-x64
path: prebuilds/linux-*
retention-days: 5
prebuild-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Setup nodejs
uses: actions/setup-node@v2
with:
node-version: 14
# x86 first.
- run: wget -nv "https://github.com/apple/foundationdb/releases/download/7.2.5/FoundationDB-7.2.5_x86_64.pkg"
- run: sudo installer -pkg FoundationDB-7.2.5_x86_64.pkg -target /
- run: yarn
- run: yarn test
# Could do a universal binary, but fdb_c isn't universal. This should be fine.
- run: yarn prebuild --arch x64
# Now install the arm version of the package and build for ARM. (Cross-compiling doesn't work otherwise - not sure why)
- run: wget -nv "https://github.com/apple/foundationdb/releases/download/7.2.5/FoundationDB-7.2.5_arm64.pkg"
- run: sudo installer -pkg FoundationDB-7.2.5_arm64.pkg -target /
- run: yarn prebuild --arch arm64
# Build for apple M1 and make sure the prebuilt module actually has arm64 code
# Blocked by https://github.com/actions/virtual-environments/issues/2486
# - run: yarn prebuild --arch arm64
# - run: lipo -archs prebuilds/darwin-arm64/node.napi.node | grep -q arm64
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: darwin
path: prebuilds/darwin-*
retention-days: 5
if-no-files-found: error
# Disabled until the windows install image is fixed.
# prebuild-windows:
# runs-on: windows-latest
# env:
# FOUNDATIONDB_INSTALL_PATH: "C:\\Program Files\\FoundationDB"
# steps:
# - uses: actions/checkout@v2
# - name: Setup nodejs
# uses: actions/setup-node@v2
# with:
# node-version: 18
# # Bleh - the 7.xx builds are currently missing one of the header files. More detail here:
# # https://forums.foundationdb.org/t/fdb-c-types-h-missing-in-windows-install-image/3817
# - run: (new-object net.webclient).DownloadFile('https://github.com/apple/foundationdb/releases/download/7.2.5/foundationdb-7.2.5-x64.msi', 'c:\foundationdb.msi')
# - run: dir c:\foundationdb.msi
# - run: msiexec /i c:\foundationdb.msi /quiet /passive /norestart /log install.log | Out-Null
# - run: echo "C:\\Program Files\\FoundationDB\bin" >> $GITHUB_PATH
# - run: yarn
# - run: yarn prebuild
# # For some reason this test fails - it can't find the prebuild even though its *right there*!!
# # - run: yarn test
# # - run: Get-ChildItem -Recurse prebuild
# - name: Upload artifacts
# uses: actions/upload-artifact@v2
# with:
# name: win32-x64
# path: prebuilds/win32-x64
# retention-days: 5
deploy-npm:
# needs: [prebuild-windows, prebuild-macos, prebuild-linux]
needs: [prebuild-macos, prebuild-linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- uses: actions/download-artifact@v3
with:
name: darwin
path: prebuilds
- uses: actions/download-artifact@v3
with:
name: linux-x64
path: prebuilds
- run: ls -R prebuilds
# Ideally I shouldn't need this...
- run: wget -nv "https://github.com/apple/foundationdb/releases/download/7.2.5/foundationdb-clients_7.2.5-1_amd64.deb"
- run: sudo dpkg -i foundationdb-clients_7.2.5-1_amd64.deb
# And I could just run the linux script last anyway.
- run: yarn
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}