From 8dfd8b6c181e32a0e363e07c2730d65f05b2554c Mon Sep 17 00:00:00 2001 From: Dawid Dziurla Date: Wed, 3 Jul 2019 19:05:00 +0200 Subject: [PATCH 1/3] goreleaser: update - move env from local context to global - define separate build for snap - build for armv6 and armv7 - fix some deprecations: - archive -> archives - brew -> brews - replace 386 with x86 (for consistency with x86_64) - add snapcraft (classic confinement, must be consulted with Canonical) --- .goreleaser.yml | 115 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 92 insertions(+), 23 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index e46c72e5..41f4ae5a 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,8 +1,12 @@ # This is an example goreleaser.yaml file with some sane defaults. # Make sure to check the documentation at http://goreleaser.com +env: + - CGO_ENABLED=0 + - GOFLAGS=-mod=vendor + - GO111MODULE=auto + builds: - - env: - - CGO_ENABLED=0 + - id: binary goos: # - freebsd # - windows # may reenable later @@ -13,23 +17,44 @@ builds: - arm - arm64 - 386 + goarm: + - 6 + - 7 ldflags: - -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.buildSource=binaryRelease + - id: snap + goos: + - linux + goarch: + - amd64 + - arm + - arm64 + - 386 + goarm: + - 6 + - 7 + ldflags: + - -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.buildSource=snap + +archives: + - builds: + - binary + replacements: + darwin: Darwin + linux: Linux + windows: Windows + 386: x86 + amd64: x86_64 + format_overrides: + - goos: windows + format: zip -archive: - replacements: - darwin: Darwin - linux: Linux - windows: Windows - 386: 32-bit - amd64: x86_64 - format_overrides: - - goos: windows - format: zip checksum: name_template: 'checksums.txt' + snapshot: name_template: '{{ .Tag }}-next' + changelog: sort: asc filters: @@ -37,16 +62,60 @@ changelog: - '^docs:' - '^test:' - '^bump' -brew: - # Reporitory to push the tap to. - github: - owner: jesseduffield - name: homebrew-lazydocker - # Your app's homepage. - # Default is empty. - homepage: 'https://github.com/jesseduffield/lazydocker/' +brews: + - github: + owner: jesseduffield + name: homebrew-lazydocker - # Your app's description. - # Default is empty. - description: 'A simple terminal UI for docker, written in Go' + # Your app's homepage. + # Default is empty. + homepage: 'https://github.com/jesseduffield/lazydocker/' + + # Your app's description. + # Default is empty. + description: 'A simple terminal UI for docker, written in Go' + +snapcrafts: + - builds: + - snap + + replacements: + linux: Linux + 386: x86 + amd64: x86_64 + + # Wether to publish the snap to the snapcraft store. + # Remember you need to `snapcraft login` first. + # Defaults to false. + publish: true + + # Single-line elevator pitch for your amazing snap. + # 79 char long at most. + summary: The lazier way to manage everything docker + + # This the description of your snap. You have a paragraph or two to tell the + # most important story about your snap. Keep it under 100 words though, + # we live in tweetspace and your description wants to look good in the snap + # store. + description: 'A simple terminal UI for docker, written in Go' + + # A guardrail to prevent you from releasing a snap to all your users before + # it is ready. + # `devel` will let you release only to the `edge` and `beta` channels in the + # store. `stable` will let you release also to the `candidate` and `stable` + # channels. More info about channels here: + # https://snapcraft.io/docs/reference/channels + grade: stable + + # Snaps can be setup to follow three different confinement policies: + # `strict`, `devmode` and `classic`. A strict confinement where the snap + # can only read and write in its own namespace is recommended. Extra + # permissions for strict snaps can be declared as `plugs` for the app, which + # are explained later. More info about confinement here: + # https://snapcraft.io/docs/reference/confinement + confinement: classic + + # Your app's license, based on SPDX license expressions: https://spdx.org/licenses + # Default is empty. + license: MIT From 27ae69a3d06e6df98c5a290b92932d4b130fcd14 Mon Sep 17 00:00:00 2001 From: Dawid Dziurla Date: Wed, 3 Jul 2019 19:23:12 +0200 Subject: [PATCH 2/3] goreleaser: switch to strict snapcraft confinement --- .goreleaser.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 41f4ae5a..0f463540 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -114,8 +114,22 @@ snapcrafts: # permissions for strict snaps can be declared as `plugs` for the app, which # are explained later. More info about confinement here: # https://snapcraft.io/docs/reference/confinement - confinement: classic + confinement: strict # Your app's license, based on SPDX license expressions: https://spdx.org/licenses # Default is empty. license: MIT + + # Each binary built by GoReleaser is an app inside the snap. In this section + # you can declare extra details for those binaries. It is optional. + apps: + + # The name of the app must be the same name as the binary built or the snapcraft name. + lazydocker: + + # If your app requires extra permissions to work outside of its default + # confined space, declare them here. + # You can read the documentation about the available plugs and the + # things they allow: + # https://snapcraft.io/docs/reference/interfaces. + plugs: ["home", "network", "docker", "docker-support"] From 73d9a36cf7b05082605d552e1699fca091d7ab5f Mon Sep 17 00:00:00 2001 From: Dawid Dziurla Date: Wed, 3 Jul 2019 19:33:54 +0200 Subject: [PATCH 3/3] README: snap installation instructions --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 12640b42..e34a98d3 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,13 @@ brew tap jesseduffield/lazydocker brew install lazydocker ``` +### Snap + +```sh +snap install lazydocker +snap connect lazydocker:docker-support +``` + ### Binary Release (Linux/OSX) You can manually download a binary release from [the release page](https://github.com/jesseduffield/lazydocker/releases).