Skip to content

Commit c43a36c

Browse files
committed
doc: automate and document release process
1 parent 12ce03a commit c43a36c

File tree

3 files changed

+109
-0
lines changed

3 files changed

+109
-0
lines changed

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ wasm:
7676
cd cmd/wasm-client; CGO_ENABLED=0 GOOS=js GOARCH=wasm go build -trimpath -ldflags="$(LDFLAGS)" -tags="$(RPC_TAGS)" -v -o wasm-client.wasm .
7777
$(CP) cmd/wasm-client/wasm-client.wasm example/wasm-client.wasm
7878

79+
clean:
80+
@$(call print, "Cleaning up.")
81+
$(RM) -r $(MOBILE_BUILD_DIR)
82+
7983
apple:
8084
@$(call print, "Building iOS and macOS cxframework ($(IOS_BUILD)).")
8185
mkdir -p $(IOS_BUILD_DIR)
@@ -120,6 +124,9 @@ repro-wasm:
120124
#Remove the repro-wasm-image
121125
docker image rm repro-wasm-image
122126

127+
release: clean mobile repro-wasm
128+
./scripts/release.sh $(version)
129+
123130
# =======
124131
# TESTING
125132
# =======

RELEASE.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# LNC Release Process
2+
3+
This document describes the steps needed to release a new version of LNC binaries.
4+
5+
### System Requirements
6+
7+
1. Android Studio with Android SDK (API level 16 or newer)
8+
2. Xcode (latest version)
9+
3. Go v1.19.8 or newer
10+
11+
### Build Release Binaries
12+
13+
From the root of the project, run the following command. Replace `X.Y.Z`
14+
with the next version number (ex: 0.2.0)
15+
16+
```sh
17+
$ make release version=X.Y.Z
18+
```
19+
20+
When this completes, a `build` dir will be created with four files:
21+
22+
- **lnc-vX.Y.Z-alpha.wasm**: the WASM reproducible binary
23+
- **lnc-vX.Y.Z-alpha-android.zip**: the gomobile library for android
24+
- **lnc-vX.Y.Z-alpha-ios.zip**: the gomobile library for iOS
25+
- **manifest-vX.Y.Z-alpha.txt**: the sha256 hash manifest file
26+
27+
### Sign the manifest and rename the signature file
28+
29+
#### Sign the manifest file using your PGP key.
30+
31+
- Replace `{PGP_EMAIL}` with your email address associated with your PGP key
32+
33+
```sh
34+
$ gpg --default-key {PGP_EMAIL} --detach-sign manifest-vX.Y.Z-alpha.txt
35+
```
36+
37+
#### Rename the manifest file.
38+
39+
- Replace `{GITHUB_USERNAME}` with your github username
40+
41+
```sh
42+
$ mv manifest-vX.Y.Z-alpha.txt.sig manifest-{GITHUB_USERNAME}-vX.Y.Z-alpha.sig
43+
```
44+
45+
### Create a tag and push to Github
46+
47+
```sh
48+
$ git tag -s vX.Y.Z-alpha -m "lightning-node-connect vX.Y.Z-alpha"
49+
$ git push origin vX.Y.Z-alpha
50+
```
51+
52+
### Create Github Release
53+
54+
On Github create a new release. Select the tag you just pushed, then click the
55+
"Auto-generate release notes" button.
56+
57+
Take the rest of the content from a previous release. Be sure to update the
58+
version number and update the verification examples to use your own PGP key.
59+
60+
In the assets, include these five files:
61+
62+
- lnc-vX.Y.Z-alpha.wasm
63+
- lnc-vX.Y.Z-alpha-android.zip
64+
- lnc-vX.Y.Z-alpha-ios.zip
65+
- manifest-vX.Y.Z-alpha.txt
66+
- manifest-{GITHUB_USERNAME}-vX.Y.Z-alpha.sig
67+
68+
### Deploy the WASM binary to CDN
69+
70+
The `lnc-vX.Y.Z-alpha.wasm` should be deployed to our CDN so it is available
71+
at the url `https://lightning.engineering/lnc-vX.Y.Z-alpha.wasm`.

scripts/release.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# /bin/bash
2+
3+
set -e
4+
5+
VERSION=${1}
6+
7+
if [ -z "${VERSION}" ]; then
8+
echo "usage: $0 <version>"
9+
exit 1
10+
fi
11+
12+
rm -rf build/
13+
mkdir build/
14+
cd build/
15+
16+
# Copy the WASM binary
17+
cp ../reproducible-builds/wasm-client.wasm lnc-v${VERSION}-alpha.wasm
18+
19+
# Zip up the iOS and Android binaries
20+
pushd ~/gocode/src/github.com/lightninglabs/lightning-node-connect/build/
21+
zip -r -X lnc-v${VERSION}-alpha-ios.zip ios/
22+
zip -r -X lnc-v${VERSION}-alpha-android.zip android/
23+
popd
24+
25+
# Copy the iOS and Android binaries
26+
cp ${GOPATH}/src/github.com/lightninglabs/lightning-node-connect/build/*.zip .
27+
28+
# Create manifest file
29+
shasum -a 256 * >> "manifest-v${VERSION}-alpha.txt"
30+
31+
cd ..

0 commit comments

Comments
 (0)