Skip to content

Commit

Permalink
Update base16-builder-go to spec 0.11 (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
belak authored Dec 16, 2023
1 parent 1d92b07 commit 5e3fc45
Show file tree
Hide file tree
Showing 12 changed files with 481 additions and 207 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "schemes"]
path = schemes
url = https://github.com/tinted-theming/base16-schemes.git
url = https://github.com/tinted-theming/schemes.git
67 changes: 33 additions & 34 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,49 +9,48 @@ builds:
goarch:
- amd64
- arm64

archives:
- format: binary
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

# Docker is split into 2 sections - the images we're building and the manifests
# we're linking them into. We start off by specifying an image for each platform
# we're building for.
dockers:
-
goos: linux
goarch: amd64
- image_templates: ["ghcr.io/base16-project/base16-builder-go:{{ .Version }}-amd64"]
use: buildx
image_templates:
- "ghcr.io/tinted-theming/base16-builder-go:{{ .Tag }}-amd64"
build_flag_templates:
- --platform=linux/amd64
extra_files:
- entrypoint.sh
build_flag_templates:
- "--platform=linux/amd64"
-
goos: linux
- image_templates: ["ghcr.io/base16-project/base16-builder-go:{{ .Version }}-arm64"]
goarch: arm64
use: buildx
image_templates:
- "ghcr.io/tinted-theming/base16-builder-go:{{ .Tag }}-arm64"
build_flag_templates:
- --platform=linux/arm64/v8
extra_files:
- entrypoint.sh
build_flag_templates:
- "--platform=linux/arm64/v8"

# The manifests link together multiple built images as a single tag. This lets
# us bundle both an amd64 and arm64 version of the same image as the same tag.
docker_manifests:
- name_template: "ghcr.io/tinted-theming/base16-builder-go:{{ .Tag }}"
- name_template: "ghcr.io/base16-project/base16-builder-go:{{ .Tag }}"
image_templates:
- "ghcr.io/tinted-theming/base16-builder-go:{{ .Tag }}-amd64"
- "ghcr.io/tinted-theming/base16-builder-go:{{ .Tag }}-arm64"
- name_template: "ghcr.io/tinted-theming/base16-builder-go:v{{ .Major }}.{{ .Minor }}"
- "ghcr.io/base16-project/base16-builder-go:{{ .Version }}-amd64"
- "ghcr.io/base16-project/base16-builder-go:{{ .Version }}-arm64"
- name_template: "ghcr.io/base16-project/base16-builder-go:v{{ .Major }}.{{ .Minor }}"
image_templates:
- "ghcr.io/tinted-theming/base16-builder-go:{{ .Tag }}-amd64"
- "ghcr.io/tinted-theming/base16-builder-go:{{ .Tag }}-arm64"
- name_template: "ghcr.io/tinted-theming/base16-builder-go:latest"
- "ghcr.io/base16-project/base16-builder-go:{{ .Version }}-amd64"
- "ghcr.io/base16-project/base16-builder-go:{{ .Version }}-arm64"
- name_template: "ghcr.io/base16-project/base16-builder-go:latest"
image_templates:
- "ghcr.io/tinted-theming/base16-builder-go:{{ .Tag }}-amd64"
- "ghcr.io/tinted-theming/base16-builder-go:{{ .Tag }}-arm64"
archives:
- format: binary
replacements:
amd64: x86_64
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- "ghcr.io/base16-project/base16-builder-go:{{ .Version }}-amd64"
- "ghcr.io/base16-project/base16-builder-go:{{ .Version }}-arm64"
21 changes: 4 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,23 @@

A simple builder for base16 templates and schemes.

This currently implements version 0.10.0 of the
[base16 spec](https://github.com/tinted-theming/home).
This currently implements version 0.11.0 of the [base16 spec](https://github.com/tinted-theming/home).

## Building

Currently version 1.16 or higher of the Go compiler is needed.

Unfortunately, because the schemes are stored in a separate repo, the schemes
repo needs to be cloned before building.
submodule needs to be cloned before building.

The following command will clone the schemes directory

```
$ git clone https://github.com/tinted-theming/base16-schemes.git schemes
$ git submodule update --init
```

Now that the repo is cloned, you can use `go build` to create a binary. You may
wish to update the schemes dir to get new included schemes. In the future this
will most likely be provided as a submodule, updated on a regular basis.
wish to update the schemes dir to get new included schemes.

## Commands

Expand All @@ -37,14 +35,3 @@ Usage of base16-builder-go:
-verbose
Log all debug messages
```

## Notes

I'm open to making a few template-specific tweaks as long as they'll be useful
to other templates. Below is a listing of the additions to the base16 spec which
this builder supports.

### Additional variables

* `scheme-slug-underscored` - A version of the scheme slug where dashes have
been replaced with underscores.
18 changes: 12 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,21 @@ module github.com/tinted-theming/base16-builder-go
go 1.18

require (
github.com/cbroglie/mustache v1.3.1
github.com/nlepage/go-tarfs v1.1.0
github.com/sirupsen/logrus v1.8.1
github.com/cbroglie/mustache v1.4.0
github.com/hashicorp/go-multierror v1.1.1
github.com/nlepage/go-tarfs v1.2.1
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.8.0
golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611
golang.org/x/text v0.14.0
gopkg.in/yaml.v3 v3.0.1
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c // indirect
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/sys v0.15.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
)
41 changes: 26 additions & 15 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,31 +1,42 @@
github.com/cbroglie/mustache v1.3.1 h1:S6Lrg+YHT9e2DOy6RZi9f+rU69F6NarEYGZGzw+X5LU=
github.com/cbroglie/mustache v1.3.1/go.mod h1:SS1FTIghy0sjse4DUVGV1k/40B1qE1XkD9DtDsHo9iM=
github.com/cbroglie/mustache v1.4.0 h1:Azg0dVhxTml5me+7PsZ7WPrQq1Gkf3WApcHMjMprYoU=
github.com/cbroglie/mustache v1.4.0/go.mod h1:SS1FTIghy0sjse4DUVGV1k/40B1qE1XkD9DtDsHo9iM=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/nlepage/go-tarfs v1.1.0 h1:bsACOiZMB/zFjYG/sE01070i9Fl26MnRpw0L6WuyfVs=
github.com/nlepage/go-tarfs v1.1.0/go.mod h1:IhxRcLhLkawBetnwu/JNuoPkq/6cclAllhgEa6SmzS8=
github.com/nlepage/go-tarfs v1.2.1 h1:o37+JPA+ajllGKSPfy5+YpsNHDjZnAoyfvf5GsUa+Ks=
github.com/nlepage/go-tarfs v1.2.1/go.mod h1:rno18mpMy9aEH1IiJVftFsqPyIpwqSUiAOpJYjlV2NA=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c h1:aFV+BgZ4svzjfabn8ERpuB4JI4N6/rdy1iusx77G3oU=
golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4=
golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/sirupsen/logrus"
)

//go:embed schemes/*.yaml
//go:embed schemes/*/*.yaml
var schemesFS embed.FS

var (
Expand All @@ -29,7 +29,7 @@ var (
version = "dev"
commit = "unknown"
date = "unknown"
specVersion = "0.10.1"
specVersion = "0.11.0"
)

func init() {
Expand All @@ -47,7 +47,7 @@ func init() {
func getSchemesFromGithub() (fs.FS, error) {
log.Info("Attempting to load schemes from GitHub")

r, err := http.Get("https://github.com/tinted-theming/base16-schemes/archive/refs/heads/main.tar.gz")
r, err := http.Get("https://github.com/tinted-theming/schemes/archive/refs/heads/spec-0.11.tar.gz")
if err != nil {
return nil, err
}
Expand All @@ -64,7 +64,7 @@ func getSchemesFromGithub() (fs.FS, error) {

// The archive has a subfolder containing all the schemes, so we return a
// subfs of the folder.
return fs.Sub(targetFS, "base16-schemes-main")
return fs.Sub(targetFS, "schemes-spec-0.11")
}

func main() {
Expand Down
Loading

0 comments on commit 5e3fc45

Please sign in to comment.