diff --git a/internals/scripts/lnd-release/.goreleaser.yml b/internals/scripts/lnd-release/.goreleaser.yml new file mode 100644 index 00000000..4374245e --- /dev/null +++ b/internals/scripts/lnd-release/.goreleaser.yml @@ -0,0 +1,58 @@ +builds: +- goos: + - linux + - darwin + - windows + goarch: + - amd64 + - "386" + ldflags: + - -X main.Commit={{.Commit}} + flags: + - -tags="experimental" +- goos: + - linux + - darwin + - windows + goarch: + - amd64 + - "386" + binary: lncli + main: ./cmd/lncli + ldflags: + - -X main.Commit={{.Commit}} + flags: + - -tags="experimental" +archive: + name_template: '{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}-v{{ .Version }}' + format: tar.gz + format_overrides: + - goos: windows + format: zip + files: + - none* + wrap_in_directory: true +checksum: + name_template: 'manifest-{{ .Version }}.txt' +snapshot: + name_template: SNAPSHOT-{{.Commit}} +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' +sign: + artifacts: checksum +git: + short_hash: true +release: + github: + owner: LN-Zap + name: lnd + prerelease: true + name_template: "{{.ProjectName}} v{{.Version}}" +before: + hooks: + - make clean + - make dep diff --git a/internals/scripts/lnd-release/README.md b/internals/scripts/lnd-release/README.md new file mode 100644 index 00000000..14a578d5 --- /dev/null +++ b/internals/scripts/lnd-release/README.md @@ -0,0 +1,39 @@ +# lnd-release + +We use [GoReleaser](https://goreleaser.com/) to build and publish the lnd binaries that we distribute with Zap Desktop. These are the steps to create a new release. + +### 1. Install GoReleaser + +See https://goreleaser.com/ + +### 2. Fetch lnd + +Fetch the lnd source code. + +``` +go get -d github.com/lightningnetwork/lnd +``` + +### 3. Copy release scripts + +Copy the scripts provided in `internals/scripts/lnd-release` over to the lnd working dir. + +``` +cp .goreleaser.yml $GOPATH/src/github.com/lightningnetwork/lnd/ +cp canary.sh $GOPATH/src/github.com/lightningnetwork/lnd/ +``` + +### 4. Create new release + +Run the provided release script, which will create a new git tag and then build and publish the lnd binaries. + +``` +cd $GOPATH/src/github.com/lightningnetwork/lnd +GITHUB_TOKEN=... ./canary.sh +``` + +You must set `GITHUB_TOKEN` to a github access token that has the ability to publish releases on the https://github.com/LN-Zap/lnd repo. + +### 5. Verify the new release + +Verify that the new build has been published to https://github.com/LN-Zap/lnd/releases diff --git a/internals/scripts/lnd-release/canary.sh b/internals/scripts/lnd-release/canary.sh new file mode 100755 index 00000000..e679070e --- /dev/null +++ b/internals/scripts/lnd-release/canary.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +git tag `git describe` || true +goreleaser release --rm-dist --skip-validate