This repository has been archived by the owner on Sep 2, 2024. It is now read-only.
fix: update GL and LDK bindings #885
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build package for Raspberry Pi | |
on: | |
push: | |
workflow_call: | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.21.x | |
- name: Set up Node for the frontend | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Build the frontend | |
run: cd frontend && yarn install && yarn build:http && cd .. | |
- name: Get dependencies | |
run: go get -v -t -d ./... | |
- name: Install cross-compiler and utilities | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y patchelf | |
wget -nv https://github.com/getAlby/gcc-arm-linux-gnueabihf/releases/download/v1.0.0/armv6-unknown-linux-gnueabihf.tar.bz2 | |
tar -xf armv6-unknown-linux-gnueabihf.tar.bz2 | |
- name: Build | |
env: | |
GOOS: linux | |
GOARCH: arm | |
GOARM: 6 | |
CGO_ENABLED: 1 | |
CC: ${{ github.workspace }}/armv6-unknown-linux-gnueabihf/bin/armv6-unknown-linux-gnueabihf-gcc | |
TAG: ${{ github.ref_name }} | |
run: go build -tags skip_breez,netgo -v -o nostr-wallet-connect -ldflags "-X 'github.com/getAlby/nostr-wallet-connect/version.Tag=${{ env.TAG }}'" cmd/http/main.go | |
- name: Find and copy shared libraries | |
run: | | |
mkdir lib | |
find `go env GOMODCACHE` -name 'libglalby_bindings.so' | grep arm-unknown-linux-gnueabihf | xargs -I {} cp {} ./lib | |
find `go env GOMODCACHE` -name 'libldk_node.so' | grep arm-unknown-linux-gnueabihf | xargs -I {} cp {} ./lib | |
- name: Strip and patch RPATH in the executable | |
run: | | |
${{ github.workspace }}/armv6-unknown-linux-gnueabihf/bin/armv6-unknown-linux-gnueabihf-strip ./nostr-wallet-connect | |
patchelf --force-rpath --set-rpath '$ORIGIN/lib' ./nostr-wallet-connect | |
# TODO: remove this once install.sh and update.sh are updated (they currently use this artifact) | |
# it produces a ZIP archive that loses all permissions | |
- name: Archive the artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nostr-wallet-connect.zip | |
path: | | |
lib/ | |
nostr-wallet-connect | |
- name: Add Linux perms | |
run: chmod +x ./nostr-wallet-connect | |
# Store everything in a tar archive to preserve permissions | |
# (specifically, the executable bit on the app executable). | |
- name: Make output tar archive | |
run: | | |
mkdir -p ./tmp | |
mv ./nostr-wallet-connect ./tmp/ | |
mv ./lib ./tmp/ | |
tar -cjf nostr-wallet-connect-rpi.tar.bz2 -C ./tmp . | |
rm -Rf ./tmp | |
- name: Upload the package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nostr-wallet-connect-rpi.tar.bz2 | |
path: nostr-wallet-connect-rpi.tar.bz2 |