Skip to content

Commit 35d0fa2

Browse files
committed
docs: describe "make docker-release"
1 parent 2f3edb9 commit 35d0fa2

File tree

2 files changed

+86
-0
lines changed

2 files changed

+86
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,8 @@ git clone https://github.com/lightninglabs/loop.git
125125
cd loop/cmd
126126
go install ./...
127127
```
128+
129+
## Reproducible builds
130+
131+
If you want to build release files yourself, follow
132+
[the guide](./docs/release.md).

docs/release.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Reproducible Builds
2+
3+
## Building with Docker
4+
5+
To create a Loop release with binaries that are identical to an official
6+
release, run the following command (available since release `v0.31.3-beta`):
7+
8+
```bash
9+
make docker-release tag=<tag-of-release>
10+
```
11+
12+
This command will create a directory named `loop-<tag-of-release>` containing
13+
the source archive, vendored dependencies, and the built binaries packaged in
14+
`.tar.gz` or `.zip` format. It also creates a manifest file with `SHA-256`
15+
checksums for all release files.
16+
17+
For example:
18+
19+
```bash
20+
make docker-release tag=v0.31.3-beta
21+
```
22+
23+
This will create the release artifacts in the `loop-v0.31.3-beta` directory.
24+
25+
If you want to build from an untagged commit, first check it out, then use the
26+
output of `git describe` as the tag:
27+
28+
```bash
29+
git describe
30+
# v0.31.2-beta-128-gfa80357
31+
32+
make docker-release tag=v0.31.2-beta-128-gfa80357
33+
```
34+
35+
You can filter the target platforms to speed up the build process. For example,
36+
to build only for `linux-amd64`:
37+
38+
```bash
39+
make docker-release buildsys=linux-amd64 tag=v0.31.3-beta
40+
```
41+
42+
Or for multiple platforms:
43+
44+
```bash
45+
make docker-release buildsys='linux-amd64 windows-amd64' tag=v0.31.3-beta
46+
```
47+
48+
Note: inside Docker the current directory is mapped as `/repo` and it might
49+
mention `/repo` as parts of file paths.
50+
51+
## Building on the Host
52+
53+
You can also build a release on your host system without Docker. You will need
54+
to install the Go version specified in the `go.mod` file, as well as a few
55+
other tools:
56+
57+
```bash
58+
sudo apt-get install build-essential git make zip perl gpg
59+
```
60+
61+
Add GPG key of Alex Bosworth to verify release tag signature:
62+
```bash
63+
gpg --keyserver keys.openpgp.org --recv-keys DE23E73BFA8A0AD5587D2FCDE80D2F3F311FD87E
64+
```
65+
66+
Then, run the `release.sh` script directly:
67+
68+
```bash
69+
./release.sh <tag-of-release>
70+
```
71+
72+
To filter the target platforms, pass them as a space-separated list in the
73+
`LOOPBUILDSYS` environment variable:
74+
75+
```bash
76+
LOOPBUILDSYS='linux-amd64 windows-amd64' ./release.sh v0.31.3-beta
77+
```
78+
79+
This will produce the same artifacts in a `loop-<tag-of-release>` directory as
80+
the `make docker-release` command. The latter simply runs the `release.sh`
81+
script inside a Docker container.

0 commit comments

Comments
 (0)