Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ LINT = $(LINT_BIN) run -v --build-tags itest

PKG := github.com/lightninglabs/lightning-node-connect
MOBILE_PKG := $(PKG)/mobile
MOBILE_BUILD_DIR :=${GOPATH}/src/$(PKG)/build
MKFILE_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
MOBILE_BUILD_DIR := $(MKFILE_DIR)/build
IOS_BUILD_DIR := $(MOBILE_BUILD_DIR)/ios
IOS_BUILD := $(IOS_BUILD_DIR)/Lncmobile.xcframework
ANDROID_BUILD_DIR := $(MOBILE_BUILD_DIR)/android
Expand Down Expand Up @@ -76,13 +77,18 @@ wasm:
cd cmd/wasm-client; CGO_ENABLED=0 GOOS=js GOARCH=wasm go build -trimpath -ldflags="$(LDFLAGS)" -tags="$(RPC_TAGS)" -v -o wasm-client.wasm .
$(CP) cmd/wasm-client/wasm-client.wasm example/wasm-client.wasm

clean:
@$(call print, "Cleaning up.")
$(RM) -r $(MOBILE_BUILD_DIR)
$(RM) -r ./reproducible-builds/

apple:
@$(call print, "Building iOS and macOS cxframework ($(IOS_BUILD)).")
@$(call print, "Building iOS and macOS xcframework ($(IOS_BUILD)).")
mkdir -p $(IOS_BUILD_DIR)
cd mobile; $(GOMOBILE_BIN) bind -target=ios,iossimulator,macos -tags="mobile $(DEV_TAGS) $(RPC_TAGS)" $(LDFLAGS_MOBILE) -v -o $(IOS_BUILD) $(MOBILE_PKG)

ios:
@$(call print, "Building iOS cxframework ($(IOS_BUILD)).")
@$(call print, "Building iOS xcframework ($(IOS_BUILD)).")
mkdir -p $(IOS_BUILD_DIR)
cd mobile; $(GOMOBILE_BIN) bind -target=ios,iossimulator -tags="mobile $(DEV_TAGS) $(RPC_TAGS)" $(LDFLAGS_MOBILE) -v -o $(IOS_BUILD) $(MOBILE_PKG)
# modify library files for import without C++ modules
Expand All @@ -92,7 +98,7 @@ ios:
sed -i.bak -E "s|$(IOS_STRING1)|$(IOS_STRING2)|g" $(IOS_FILE4)

macos:
@$(call print, "Building macOS cxframework ($(IOS_BUILD)).")
@$(call print, "Building macOS xcframework ($(IOS_BUILD)).")
mkdir -p $(IOS_BUILD_DIR)
cd mobile; $(GOMOBILE_BIN) bind -target=macos -tags="mobile $(DEV_TAGS) $(RPC_TAGS)" $(LDFLAGS_MOBILE) -v -o $(IOS_BUILD) $(MOBILE_PKG)

Expand Down Expand Up @@ -120,6 +126,10 @@ repro-wasm:
#Remove the repro-wasm-image
docker image rm repro-wasm-image

release: clean mobile repro-wasm
@$(call print, "Building release binaries for $(tag).")
./scripts/release.sh $(tag)

# =======
# TESTING
# =======
Expand Down
66 changes: 66 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# LNC Release Process

This document describes the steps needed to release a new version of LNC binaries.

### System Requirements

1. Android Studio with Android SDK (API level 16 or newer)
2. Xcode (latest version)
3. Go v1.19.8 or newer

### Build Release Binaries

From the root of the project, run the following command. Replace `vX.Y.Z-alpha`
with the next version number (ex: v0.2.0-alpha)

```sh
$ make release tag=vX.Y.Z-alpha
```

When this completes, a `build` dir will be created with four files:

- **lnc-vX.Y.Z-alpha.wasm**: the WASM reproducible binary
- **lnc-vX.Y.Z-alpha-android.zip**: the gomobile library for android
- **lnc-vX.Y.Z-alpha-ios.zip**: the gomobile library for iOS
- **manifest-vX.Y.Z-alpha.txt**: the sha256 hash manifest file

### Sign the manifest and rename the signature file

#### Sign the manifest file using your PGP key.

- Replace `{PGP_EMAIL}` with your email address associated with your PGP key
- Replace `{GITHUB_USERNAME}` with your github username

```sh
$ gpg --default-key {PGP_EMAIL} --output manifest-{GITHUB_USERNAME}-vX.Y.Z-alpha.sig --detach-sign manifest-vX.Y.Z-alpha.txt
```

### Create a tag and push to Github

Using the `-s` option signs the tag with your PGP key

```sh
$ git tag -s vX.Y.Z-alpha -m "lightning-node-connect vX.Y.Z-alpha"
$ git push origin vX.Y.Z-alpha
```

### Create Github Release

On Github create a new release. Select the tag you just pushed, then click the
"Auto-generate release notes" button.

Take the rest of the content from a previous release. Be sure to update the
version number and update the verification examples to use your own PGP key.

In the assets, include these five files:

- lnc-vX.Y.Z-alpha.wasm
- lnc-vX.Y.Z-alpha-android.zip
- lnc-vX.Y.Z-alpha-ios.zip
- manifest-vX.Y.Z-alpha.txt
- manifest-{GITHUB_USERNAME}-vX.Y.Z-alpha.sig

### Deploy the WASM binary to CDN

The `lnc-vX.Y.Z-alpha.wasm` should be deployed to our CDN so it is available
at the url `https://lightning.engineering/lnc-vX.Y.Z-alpha.wasm`.
32 changes: 32 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

set -e

DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)"
BUILD_DIR=${DIR}/../build
TAG=${1}

if [ -z "${TAG}" ]; then
echo "usage: $0 <tag>"
echo "Example: $0 v0.1.0-alpha"
exit 1
fi

pushd ${BUILD_DIR}

# Copy the WASM binary
cp ../reproducible-builds/wasm-client.wasm lnc-${TAG}.wasm
rm -rf ../reproducible-builds/

# Zip up the iOS and Android binaries
zip -r -X lnc-${TAG}-ios.zip ios/
zip -r -X lnc-${TAG}-android.zip android/

# Remove the iOS and Android dirs after zipping
rm -rf ios/
rm -rf android/

# Create manifest file
shasum -a 256 * >> "manifest-${TAG}.txt"

popd