Skip to content

Commit ec5395b

Browse files
committed
github/workflows: add tag triggered release build
1 parent 911b7b6 commit ec5395b

File tree

1 file changed

+142
-0
lines changed

1 file changed

+142
-0
lines changed

.github/workflows/release.yaml

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
name: Release build
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
defaults:
9+
run:
10+
shell: bash
11+
12+
env:
13+
GO_VERSION: 1.21.0
14+
15+
jobs:
16+
main:
17+
name: Release build
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: git checkout
21+
uses: actions/checkout@v2
22+
with:
23+
fetch-depth: 0
24+
25+
- name: setup go ${{ env.GO_VERSION }}
26+
uses: actions/setup-go@v2
27+
with:
28+
go-version: '${{ env.GO_VERSION }}'
29+
30+
- name: Set env
31+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
32+
33+
- name: build release for all architectures
34+
run: SKIP_VERSION_CHECK=1 make release tag=${{ env.RELEASE_VERSION }}
35+
36+
- name: Create Release
37+
uses: lightninglabs/gh-actions/[email protected]
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
with:
41+
tag_name: ${{ env.RELEASE_VERSION }}
42+
name: tapd ${{ env.RELEASE_VERSION }}
43+
draft: true
44+
prerelease: false
45+
files: tapd-${{ env.RELEASE_VERSION }}/*
46+
body: |
47+
# Database Migrations
48+
TODO
49+
50+
# Verifying the Release
51+
52+
In order to verify the release, you'll need to have `gpg` or `gpg2` installed on your system. Once you've obtained a copy (and hopefully verified that as well), you'll first need to import the keys that have signed this release if you haven't done so already:
53+
54+
```
55+
curl https://raw.githubusercontent.com/lightninglabs/taproot-assets/main/scripts/keys/roasbeef.asc | gpg --import
56+
```
57+
58+
Once you have the required PGP keys, you can verify the release (assuming `manifest-roasbeef-${{ env.RELEASE_VERSION }}.sig` and `manifest-${{ env.RELEASE_VERSION }}.txt` are in the current directory) with:
59+
60+
```
61+
gpg --verify manifest-roasbeef-${{ env.RELEASE_VERSION }}.sig manifest-${{ env.RELEASE_VERSION }}.txt
62+
```
63+
64+
You should see the following if the verification was successful:
65+
66+
```
67+
gpg: Signature made Wed Sep 30 17:35:20 2020 PDT
68+
gpg: using RSA key 60A1FA7DA5BFF08BDCBBE7903BBD59E99B280306
69+
gpg: Good signature from "Olaoluwa Osuntokun <[email protected]>" [ultimate]
70+
```
71+
72+
That will verify the signature of the manifest file, which ensures integrity and authenticity of the archive you've downloaded locally containing the binaries. Next, depending on your operating system, you should then re-compute the `sha256` hash of the archive with `shasum -a 256 <filename>`, compare it with the corresponding one in the manifest file, and ensure they match *exactly*.
73+
74+
## Verifying the Release Timestamp
75+
76+
From this new version onwards, in addition time-stamping the _git tag_ with [OpenTimestamps](https://opentimestamps.org/), we'll also now timestamp the manifest file along with its signature. Two new files are now included along with the rest of our release artifacts: ` manifest-roasbeef-${{ env.RELEASE_VERSION }}.txt.asc.ots`.
77+
78+
Assuming you have the opentimestamps client installed locally, the timestamps can be verified with the following commands:
79+
```
80+
ots verify manifest-roasbeef-${{ env.RELEASE_VERSION }}.sig.ots -f manifest-roasbeef-${{ env.RELEASE_VERSION }}.sig
81+
```
82+
83+
Alternatively, [the OpenTimestamps website](https://opentimestamps.org/) can be used to verify timestamps if one doesn't have a `bitcoind` instance accessible locally.
84+
85+
These timestamps should give users confidence in the integrity of this release even after the key that signed the release expires.
86+
87+
## Verifying the Release Binaries
88+
89+
Our release binaries are fully reproducible. Third parties are able to verify that the release binaries were produced properly without having to trust the release manager(s). See our [reproducible builds guide](https://github.com/lightninglabs/taproot-assets/blob/main/docs/release.md) for how this can be achieved.
90+
The release binaries are compiled with `go${{ env.GO_VERSION }}`, which is required by verifiers to arrive at the same ones.
91+
92+
The `make release` command can be used to ensure one rebuilds with all the same flags used for the release. If one wishes to build for only a single platform, then `make release sys=<OS-ARCH> tag=<tag>` can be used.
93+
94+
Finally, you can also verify the _tag_ itself with the following command:
95+
96+
```
97+
$ git verify-tag ${{ env.RELEASE_VERSION }}
98+
gpg: Signature made Tue Sep 15 18:55:00 2020 PDT
99+
gpg: using RSA key 60A1FA7DA5BFF08BDCBBE7903BBD59E99B280306
100+
gpg: Good signature from "Olaoluwa Osuntokun <[email protected]>" [ultimate]
101+
```
102+
103+
## Verifying the Docker Images
104+
105+
To verify the `tapd` and `tapcli` binaries inside the docker images against the signed, reproducible release binaries, there is a verification script in the image that can be called (before starting the container for example):
106+
107+
```shell
108+
$ docker run --rm --entrypoint="" lightninglabs/taproot-assets:${{ env.RELEASE_VERSION }} /verify-install.sh ${{ env.RELEASE_VERSION }}
109+
$ OK=$?
110+
$ if [ "$OK" -ne "0" ]; then echo "Verification failed!"; exit 1; done
111+
$ docker run lightninglabs/taproot-assets [command-line options]
112+
```
113+
114+
# Building the Contained Release
115+
116+
Users are able to rebuild the target release themselves without having to fetch any of the dependencies. In order to do so, assuming
117+
that `vendor.tar.gz` and `tapd-source-${{ env.RELEASE_VERSION }}.tar.gz` are in the current directory, follow these steps:
118+
119+
```
120+
tar -xvzf vendor.tar.gz
121+
tar -xvzf tapd-source-${{ env.RELEASE_VERSION }}.tar.gz
122+
GO111MODULE=on go install -v -mod=vendor -ldflags "-X github.com/lightninglabs/taproot-assets/build.Commit=${{ env.RELEASE_VERSION }}" ./cmd/tapd
123+
GO111MODULE=on go install -v -mod=vendor -ldflags "-X github.com/lightninglabs/taproot-assets/build.Commit=${{ env.RELEASE_VERSION }}" ./cmd/tapcli
124+
```
125+
126+
The `-mod=vendor` flag tells the `go build` command that it doesn't need to fetch the dependencies, and instead, they're all enclosed in the local vendor directory.
127+
128+
Additionally, it's now possible to use the enclosed `release.sh` script to bundle a release for a _specific_ system like so:
129+
130+
```
131+
make release sys="linux-arm64 darwin-amd64"
132+
```
133+
134+
⚡️⚡️⚡️ OK, now to the rest of the release notes! ⚡️⚡️⚡️
135+
136+
# Release Notes
137+
138+
TODO
139+
140+
# Contributors (Alphabetical Order)
141+
142+
TODO

0 commit comments

Comments
 (0)