[chore] Update goreleaser build tags, add env vars (#4592)

# Description

> If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.
>
> If this is a documentation change, please briefly describe what you've changed and why.

This pull request updates our build tags in goreleaser to bring them in line with `scripts/build.sh`, and also adds env var options for accessing the various build tags when building GtS with goreleaser.

## Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]`

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

- [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md).
- [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
- [x] I/we have not leveraged AI to create the proposed changes.
- [x] I/we have performed a self-review of added code.
- [x] I/we have written code that is legible and maintainable by others.
- [x] I/we have commented the added code, particularly in hard-to-understand areas.
- [ ] I/we have made any necessary changes to documentation.
- [ ] I/we have added tests that cover new code.
- [x] I/we have run tests and they pass locally with the changes.
- [x] I/we have run `go fmt ./...` and `golangci-lint run`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4592
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
This commit is contained in:
tobi
2025-11-30 13:49:53 +01:00
committed by tobi
parent dd4452a467
commit 56143a7e77
3 changed files with 34 additions and 8 deletions
+29 -3
View File
@@ -37,8 +37,21 @@ builds:
- netgo
- osusergo
- static_build
- kvformat
- timetzdata
- nomsgpack
- stdlibjson
- >-
{{ if and (index .Env "NOOTEL") (.Env.NOOTEL) }}nootel{{ end }}
- >-
{{ if and (index .Env "NOSQLITE") (.Env.NOSQLITE) }}nosqlite{{ end }}
- >-
{{ if and (index .Env "NOPOSTGRES") (.Env.NOPOSTGRES) }}nopostgres{{ end }}
- >-
{{ if and (index .Env "NOS3") (.Env.NOS3) }}nos3{{ end }}
- >-
{{ if and (index .Env "NOOIDC") (.Env.NOOIDC) }}nooidc{{ end }}
- >-
{{ if and (index .Env "NOERRCALLER") (.Env.NOERRCALLER) }}noerrcaller{{ end }}
- >-
{{ if and (index .Env "DEBUG") (.Env.DEBUG) }}debugenv{{ end }}
env:
@@ -66,9 +79,22 @@ builds:
- netgo
- osusergo
- static_build
- kvformat
- timetzdata
- nowasm
- nomsgpack
- stdlibjson
- nowasm # <-- set the nowasm flag
- >-
{{ if and (index .Env "NOOTEL") (.Env.NOOTEL) }}nootel{{ end }}
- >-
{{ if and (index .Env "NOSQLITE") (.Env.NOSQLITE) }}nosqlite{{ end }}
- >-
{{ if and (index .Env "NOPOSTGRES") (.Env.NOPOSTGRES) }}nopostgres{{ end }}
- >-
{{ if and (index .Env "NOS3") (.Env.NOS3) }}nos3{{ end }}
- >-
{{ if and (index .Env "NOOIDC") (.Env.NOOIDC) }}nooidc{{ end }}
- >-
{{ if and (index .Env "NOERRCALLER") (.Env.NOERRCALLER) }}noerrcaller{{ end }}
- >-
{{ if and (index .Env "DEBUG") (.Env.DEBUG) }}debugenv{{ end }}
env:
+1 -1
View File
@@ -237,7 +237,7 @@ func Start(ctx context.Context) error {
})
// build router modules
var idp oidc.IDP
var idp *oidc.IDP
if config.GetOIDCEnabled() {
idp, err = oidc.NewIDP(ctx)
if err != nil {
+4 -4
View File
@@ -26,12 +26,12 @@ import (
"code.superseriousbusiness.org/gotosocial/internal/gtserror"
"code.superseriousbusiness.org/gotosocial/internal/log"
"codeberg.org/gruf/go-storage/disk"
"codeberg.org/gruf/go-storage"
)
// Driver wraps a disk.DiskStorage to
// provide optimized write operations.
type Driver struct{ Storage *disk.DiskStorage }
// Driver wraps a disk or memory storage.Storage
// to provide optimized write operations.
type Driver struct{ Storage storage.Storage }
// PutFile: see PutFile() in storage.go.
func (d *Driver) PutFile(ctx context.Context, key, filepath, _ string) (int64, error) {