/ .github / workflows / release.yaml
release.yaml
  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    # If you change this please also update GO_VERSION in Makefile (then run
 14    # `make lint` to see where else it needs to be updated as well).
 15    GO_VERSION: 1.25.5
 16  
 17  jobs:
 18    ########################
 19    # Create release
 20    ########################
 21    main:
 22      name: Release build
 23      runs-on: ubuntu-latest
 24      steps:
 25        - name: git checkout
 26          uses: actions/checkout@v4
 27          with:
 28            fetch-depth: 0
 29  
 30        - name: cleanup space
 31          uses: ./.github/actions/cleanup-space
 32  
 33        - name: setup go ${{ env.GO_VERSION }}
 34          uses: actions/setup-go@v5
 35          with:
 36            go-version: '${{ env.GO_VERSION }}'
 37            cache: 'false'
 38  
 39        - name: Set env
 40          run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
 41  
 42        - name: build release for all architectures
 43          run: SKIP_VERSION_CHECK=1 make release tag=${{ env.RELEASE_VERSION }}
 44  
 45        - name: Create Release
 46          uses: lightninglabs/gh-actions/action-gh-release@c7149b6a7818d1c39b36b69e727569897b6f2c5a
 47          env:
 48            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 49          with:
 50            name: lnd ${{ env.RELEASE_VERSION }}
 51            draft: true
 52            prerelease: false
 53            files: lnd-${{ env.RELEASE_VERSION }}/*
 54            body: |
 55              # Database Migrations
 56              TODO
 57  
 58              # Verifying the Release
 59  
 60              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: 
 61  
 62              ```
 63              curl https://raw.githubusercontent.com/lightningnetwork/lnd/master/scripts/keys/roasbeef.asc | gpg --import
 64              ```
 65  
 66              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:
 67  
 68              ```
 69              gpg --verify manifest-roasbeef-${{ env.RELEASE_VERSION }}.sig manifest-${{ env.RELEASE_VERSION }}.txt
 70              ```
 71  
 72              You should see the following if the verification was successful:
 73  
 74              ```
 75              gpg: Signature made Wed Sep 30 17:35:20 2020 PDT
 76              gpg:                using RSA key 60A1FA7DA5BFF08BDCBBE7903BBD59E99B280306
 77              gpg: Good signature from "Olaoluwa Osuntokun <laolu32@gmail.com>" [ultimate]
 78              ```
 79  
 80              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*.
 81  
 82              ## Verifying the Release Timestamp 
 83  
 84              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`.
 85  
 86              Assuming you have the opentimestamps client installed locally, the timestamps can be verified with the following commands: 
 87              ```
 88              ots verify manifest-roasbeef-${{ env.RELEASE_VERSION }}.sig.ots -f manifest-roasbeef-${{ env.RELEASE_VERSION }}.sig
 89              ```
 90  
 91              Alternatively, [the OpenTimestamps website](https://opentimestamps.org/) can be used to verify timestamps if one doesn't have a `bitcoind` instance accessible locally.
 92  
 93              These timestamps should give users confidence in the integrity of this release even after the key that signed the release expires. 
 94  
 95              ## Verifying the Release Binaries
 96  
 97              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/lightningnetwork/lnd/blob/master/docs/release.md) for how this can be achieved.
 98              The release binaries are compiled with `go${{ env.GO_VERSION }}`, which is required by verifiers to arrive at the same ones.
 99              They include the following build tags: `autopilotrpc`, `signrpc`, `walletrpc`, `chainrpc`, `invoicesrpc`, `neutrinorpc`, `routerrpc`, `watchtowerrpc`, `monitoring`, `peersrpc`, `kvdb_postrgres`, `kvdb_etcd` and `kvdb_sqlite`. Note that these are already included in the release script, so they do not need to be provided.
100  
101              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. 
102  
103              Finally, you can also verify the _tag_ itself with the following command:
104  
105              ```
106              $ git verify-tag ${{ env.RELEASE_VERSION }}
107              gpg: Signature made Tue Sep 15 18:55:00 2020 PDT
108              gpg:                using RSA key 60A1FA7DA5BFF08BDCBBE7903BBD59E99B280306
109              gpg: Good signature from "Olaoluwa Osuntokun <laolu32@gmail.com>" [ultimate]
110              ```
111  
112              ## Verifying the Docker Images
113  
114              To verify the `lnd` and `lncli` 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):
115  
116              ```shell
117              $ docker run --rm --entrypoint="" lightninglabs/lnd:${{ env.RELEASE_VERSION }} /verify-install.sh ${{ env.RELEASE_VERSION }}
118              $ OK=$?
119              $ if [ "$OK" -ne "0" ]; then echo "Verification failed!"; exit 1; done
120              $ docker run lightninglabs/lnd [command-line options]
121              ```
122  
123              # Building the Contained Release 
124  
125              Users are able to rebuild the target release themselves without having to fetch any of the dependencies. In order to do so, assuming
126              that `vendor.tar.gz` and `lnd-source-${{ env.RELEASE_VERSION }}.tar.gz` are in the current directory, follow these steps:
127  
128              ```
129              tar -xvzf lnd-source-${{ env.RELEASE_VERSION }}.tar.gz
130              mv vendor.tar.gz lnd-source/
131              cd lnd-source
132              tar -xvzf vendor.tar.gz
133              go install -v -mod=vendor -ldflags "-X github.com/lightningnetwork/lnd/build.Commit=${{ env.RELEASE_VERSION }}" ./cmd/lnd
134              go install -v -mod=vendor -ldflags "-X github.com/lightningnetwork/lnd/build.Commit=${{ env.RELEASE_VERSION }}" ./cmd/lncli
135              ```
136  
137              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. 
138  
139              Additionally, it's now possible to use the [enclosed `release.sh` script to bundle a release for a _specific_ system like so](https://github.com/lightningnetwork/lnd/pull/2191): 
140  
141              ```
142              make release sys="linux-arm64 darwin-amd64"
143              ```
144  
145              ⚡️⚡️⚡️ OK, now to the rest of the release notes! ⚡️⚡️⚡️
146  
147              # Release Notes
148  
149              TODO
150  
151              # Contributors (Alphabetical Order)
152  
153              TODO