This repository has been archived by the owner on Feb 17, 2023. It is now read-only.
forked from josephg/node-foundationdb
-
Notifications
You must be signed in to change notification settings - Fork 0
125 lines (100 loc) · 3.47 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
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: 14
- run: wget "https://www.foundationdb.org/downloads/6.3.12/ubuntu/installers/foundationdb-clients_6.3.12-1_amd64.deb"
- run: sudo dpkg -i foundationdb-clients_6.3.12-1_amd64.deb
- run: sudo mkdir -p /var/lib/foundationdb/data
- run: wget "https://www.foundationdb.org/downloads/6.3.12/ubuntu/installers/foundationdb-server_6.3.12-1_amd64.deb"
- run: sudo dpkg -i foundationdb-server_6.3.12-1_amd64.deb
- run: yarn
- run: yarn prebuild
- run: yarn test
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: linux-x64
path: prebuilds/linux-x64
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
- run: wget "https://www.foundationdb.org/downloads/6.3.12/macOS/installers/FoundationDB-6.3.12.pkg"
- run: sudo installer -pkg FoundationDB-6.3.12.pkg -target /
- run: yarn
- run: yarn prebuild
# 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
- run: yarn test
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: darwin-x64
path: prebuilds/darwin-x64
retention-days: 5
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: 14
- run: (new-object net.webclient).DownloadFile('https://www.foundationdb.org/downloads/6.3.12/windows/installers/foundationdb-6.3.12-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
# - run: yarn test
- run: Get-ChildItem -Recurse
- 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]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
registry-url: 'https://registry.npmjs.org'
- uses: actions/download-artifact@v2
with:
path: prebuilds
- run: ls -R prebuilds
# Ideally I shouldn't need this...
- run: wget "https://www.foundationdb.org/downloads/6.3.12/ubuntu/installers/foundationdb-clients_6.3.12-1_amd64.deb"
- run: sudo dpkg -i foundationdb-clients_6.3.12-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 }}