This repository has been archived by the owner on Sep 2, 2024. It is now read-only.
forked from getAlby/nostr-wallet-connect
-
Notifications
You must be signed in to change notification settings - Fork 3
79 lines (66 loc) · 2.58 KB
/
http.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
name: Linux-amd64 build executable
on:
push:
workflow_call:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
name: Check out code
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y patchelf gcc
- name: Setup GoLang
uses: actions/setup-go@v5
with:
check-latest: true
go-version: 1.21
- name: Get dependencies
run: go get -v -t -d ./...
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: "20.x"
- name: Run tests
run: mkdir frontend/dist && touch frontend/dist/tmp && go test ./...
- name: Build frontend
run: |
cd frontend
yarn install
yarn build:http
shell: bash
- name: Create build directory
run: |
mkdir -p ./build/bin/albyhub-${{runner.os}}-x86_64/lib
- name: Build Binary for linux amd64
run: CGO_ENABLED=1 go build -o build/bin/albyhub-${{runner.os}}-x86_64/bin/albyhub-x86_64 cmd/http/main.go
- name: Copy shared libraries to the output directory
run: |
mkdir -p ./build/bin/albyhub-${{runner.os}}-x86_64/lib
cp `go list -m -f "{{.Dir}}" github.com/breez/breez-sdk-go`/breez_sdk/lib/linux-amd64/libbreez_sdk_bindings.so ./build/bin/albyhub-${{runner.os}}-x86_64/lib/
cp `go list -m -f "{{.Dir}}" github.com/getAlby/glalby-go`/glalby/x86_64-unknown-linux-gnu/libglalby_bindings.so ./build/bin/albyhub-${{runner.os}}-x86_64/lib/
cp `go list -m -f "{{.Dir}}" github.com/getAlby/ldk-node-go`/ldk_node/x86_64-unknown-linux-gnu/libldk_node.so ./build/bin/albyhub-${{runner.os}}-x86_64/lib/
shell: bash
- name: Patch executable RPATH
run: |
patchelf --force-rpath --set-rpath '$ORIGIN/../lib' ./build/bin/albyhub-${{runner.os}}-x86_64/bin/albyhub-x86_64
- name: Add Linux perms
run: |
chmod +x build/bin/albyhub-${{runner.os}}-x86_64/bin/albyhub-x86_64
shell: bash
- name: Make output tar archive to keep file permissions
run: |
mkdir -p ./build/out
tar czf ./build/out/albyhub-${{runner.os}}-x86_64.tar.gz -C ./build/bin/albyhub-${{runner.os}}-x86_64 .
- uses: actions/upload-artifact@v4
with:
name: albyhub-${{runner.os}}-x86_64.tar.gz
path: |
./build/out/albyhub-${{runner.os}}-x86_64.tar.gz
if-no-files-found: error