Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add goreleaser settings #49

Merged
merged 7 commits into from
Dec 18, 2023
Merged

ci: add goreleaser settings #49

merged 7 commits into from
Dec 18, 2023

Conversation

supercaracal
Copy link
Contributor

@supercaracal supercaracal commented Dec 14, 2023

I'd say that it would be better to use tools instead of manual upload for distribution of built files.

Since fanlin depends on WebP library for Golang, it seems that we can't disable cgo. Also, in GitHub Actions, it looks difficult to do cross-compiling to Windows, macOS and ARM architectures on the latest Ubuntu machine if cgo enabled.

Please let me know if there are overlooking somethings. I'm not familiar with WebP. But I think it's OK if the following test case is passed in CI.

func TestEncodeWebP(t *testing.T) {
// Lossless
img, _ := DecodeImage(webpLosslessBin)
webpLosslessBin.Seek(0, 0)
if format := img.GetFormat(); format != "webp" {
t.Fatalf("format is %v, expected webp", format)
}
bin, err := EncodeWebP(img.GetImg(), -1, true)
if err != nil {
t.Fatalf("err is %v.", err)
}
if bin == nil {
t.Fatalf("bin is nil.")
}
// Lossy
img, _ = DecodeImage(webpLossyBin)
webpLossyBin.Seek(0, 0)
if format := img.GetFormat(); format != "webp" {
t.Fatalf("format is %v, expected webp", format)
}
bin, err = EncodeWebP(img.GetImg(), -1, false)
if err != nil {
t.Fatalf("err is %v.", err)
}
if bin == nil {
t.Fatalf("bin is nil.")
}
// error
img, _ = DecodeImage(confBin)
confBin.Seek(0, 0)
_, err = EncodeWebP(img.GetImg(), 50, true)
if err == nil {
t.Fatalf("err is %v.", err)
}
}

@supercaracal supercaracal marked this pull request as ready for review December 14, 2023 07:55
@supercaracal supercaracal requested a review from etsxxx December 14, 2023 07:55
.goreleaser.yaml Outdated Show resolved Hide resolved
@supercaracal supercaracal merged commit 6c63c54 into master Dec 18, 2023
1 check passed
@supercaracal supercaracal deleted the add-go-releaser branch December 18, 2023 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants