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
feat: darwin arm64 binary #690
Changes from 8 commits
e2bc0af
9eb9f44
ece1a3f
13f2893
c29c06c
9852dd0
2b8253d
97945d6
466d5a7
3c75018
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,22 +9,24 @@ jobs: | |
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Go 1.17 | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.17 | ||
id: go | ||
|
||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Fetch tags | ||
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
|
||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }} | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
- name: release dry run | ||
run: make release-dry-run | ||
Comment on lines
+23
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This container image is awfully big. I wouldn't want this running that often as I don't personally understand the implications for GHA for this org. |
||
|
||
- name: setup release environment | ||
run: |- | ||
echo 'GITHUB_TOKEN=${{secrets.GORELEASER_GITHUB_TOKEN }}' > .release-env | ||
|
||
- name: release publish | ||
run: make release | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,95 @@ | ||
# GoReleaser config | ||
|
||
--- | ||
before: | ||
hooks: | ||
- go mod tidy | ||
|
||
builds: | ||
- id: pop_darwin | ||
binary: soda | ||
main: soda/main.go | ||
goos: | ||
- darwin | ||
goarch: | ||
- amd64 | ||
env: | ||
- CGO_ENABLED=1 | ||
- CC=o64-clang | ||
- CXX=o64-clang++ | ||
flags: | ||
- -tags | ||
- sqlite | ||
- id: pop_darwin | ||
binary: soda | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I changed the indentation as my vimconfig make it obnoxious. Maybe I should undo that because this looks more gnarly than it is. |
||
main: soda/main.go | ||
goos: | ||
- darwin | ||
goarch: | ||
- amd64 | ||
ldflags: | ||
- -s | ||
env: | ||
- CGO_ENABLED=1 | ||
- CC=/osxcross/target/bin/o64-clang | ||
- CXX=/osxcross/target/bin/o64-clang++ | ||
flags: | ||
- -tags | ||
- sqlite | ||
|
||
- id: pop_linux | ||
binary: soda | ||
main: soda/main.go | ||
env: | ||
- CGO_ENABLED=1 | ||
flags: | ||
- -tags | ||
- sqlite | ||
goos: | ||
- linux | ||
goarch: | ||
- amd64 | ||
- 386 | ||
- id: pop_darwin_arm64 | ||
binary: soda | ||
main: soda/main.go | ||
goos: | ||
- darwin | ||
goarch: | ||
- arm64 | ||
ldflags: | ||
- -s | ||
env: | ||
- CGO_ENABLED=1 | ||
- CC=/osxcross/target/bin/oa64-clang | ||
- CXX=/osxcross/target/bin/oa64-clang++ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I separated out pop_darwin and pop_darwin_arm64 as darwin_arm64 suggests oa64-clang/oa64-clang++ on https://github.com/goreleaser/goreleaser-cross#supported-toolchainsplatforms. |
||
flags: | ||
- -tags | ||
- sqlite | ||
|
||
- id: pop_windows_i686 | ||
binary: soda | ||
main: soda/main.go | ||
ldflags: | ||
- "-extldflags '-static'" | ||
env: | ||
- CGO_ENABLED=1 | ||
- CC=i686-w64-mingw32-gcc | ||
- CXX=i686-w64-mingw32-g++ | ||
flags: | ||
- -tags | ||
- sqlite | ||
goos: | ||
- windows | ||
goarch: | ||
- 386 | ||
- id: pop_linux | ||
binary: soda | ||
main: soda/main.go | ||
env: | ||
- CGO_ENABLED=0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I changed |
||
flags: | ||
- -tags | ||
- sqlite | ||
goos: | ||
- linux | ||
goarch: | ||
- amd64 | ||
- 386 | ||
|
||
- id: pop_windows_x64 | ||
binary: soda | ||
main: soda/main.go | ||
ldflags: | ||
- "-extldflags '-static'" | ||
env: | ||
- CGO_ENABLED=1 | ||
- CC=x86_64-w64-mingw32-gcc | ||
- CXX=x86_64-w64-mingw32-g++ | ||
flags: | ||
- -tags | ||
- sqlite | ||
goos: | ||
- windows | ||
goarch: | ||
- amd64 | ||
- id: pop_windows_i686 | ||
binary: soda | ||
main: soda/main.go | ||
ldflags: | ||
- "-extldflags '-static'" | ||
env: | ||
- CGO_ENABLED=1 | ||
- CC=i686-w64-mingw32-gcc | ||
- CXX=i686-w64-mingw32-g++ | ||
flags: | ||
- -tags | ||
- sqlite | ||
goos: | ||
- windows | ||
goarch: | ||
- 386 | ||
|
||
- id: pop_windows_x64 | ||
binary: soda | ||
main: soda/main.go | ||
ldflags: | ||
- "-extldflags '-static'" | ||
env: | ||
- CGO_ENABLED=1 | ||
- CC=x86_64-w64-mingw32-gcc | ||
- CXX=x86_64-w64-mingw32-g++ | ||
flags: | ||
- -tags | ||
- sqlite | ||
goos: | ||
- windows | ||
goarch: | ||
- amd64 | ||
|
||
archives: | ||
- | ||
format_overrides: | ||
- format_overrides: | ||
- goos: windows | ||
format: zip | ||
|
||
|
@@ -88,8 +107,7 @@ changelog: | |
- '^test:' | ||
|
||
brews: | ||
- | ||
name: 'pop' | ||
- name: 'pop' | ||
tap: | ||
owner: gobuffalo | ||
name: homebrew-tap | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
PACKAGE_NAME := github.com/gobuffalo/pop | ||
GOLANG_CROSS_VERSION ?= v1.17.6 | ||
|
||
TAGS ?= "sqlite" | ||
GO_BIN ?= go | ||
|
||
|
@@ -37,5 +40,41 @@ endif | |
release-test: | ||
./test.sh | ||
|
||
.PHONY: sysroot-pack | ||
sysroot-pack: | ||
@tar cf - $(SYSROOT_DIR) -P | pv -s $[$(du -sk $(SYSROOT_DIR) | awk '{print $1}') * 1024] | pbzip2 > $(SYSROOT_ARCHIVE) | ||
|
||
.PHONY: sysroot-unpack | ||
sysroot-unpack: | ||
@pv $(SYSROOT_ARCHIVE) | pbzip2 -cd | tar -xf - | ||
Comment on lines
+43
to
+49
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't see anywhere that these functions are explicitly used, they just came from https://github.com/goreleaser/goreleaser-cross-example/blob/master/Makefile#L7-L13. These could probably be removed. |
||
|
||
.PHONY: release-dry-run | ||
release-dry-run: | ||
@docker run \ | ||
--rm \ | ||
--privileged \ | ||
-e CGO_ENABLED=1 \ | ||
-v /var/run/docker.sock:/var/run/docker.sock \ | ||
-v `pwd`:/go/src/$(PACKAGE_NAME) \ | ||
-v `pwd`/sysroot:/sysroot \ | ||
-w /go/src/$(PACKAGE_NAME) \ | ||
goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \ | ||
--rm-dist --skip-validate --skip-publish --snapshot | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When I was running without |
||
|
||
.PHONY: release | ||
release: | ||
release -y -f soda/cmd/version.go | ||
@if [ ! -f ".release-env" ]; then \ | ||
echo "\033[91m.release-env is required for release\033[0m";\ | ||
exit 1;\ | ||
fi | ||
docker run \ | ||
--rm \ | ||
--privileged \ | ||
-e CGO_ENABLED=1 \ | ||
--env-file .release-env \ | ||
-v /var/run/docker.sock:/var/run/docker.sock \ | ||
-v `pwd`:/go/src/$(PACKAGE_NAME) \ | ||
-v `pwd`/sysroot:/sysroot \ | ||
-w /go/src/$(PACKAGE_NAME) \ | ||
goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \ | ||
release --rm-dist |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package associations | ||
|
||
import ( | ||
"database/sql" | ||
"fmt" | ||
"github.com/gobuffalo/nulls" | ||
"github.com/gofrs/uuid" | ||
"github.com/stretchr/testify/assert" | ||
"testing" | ||
) | ||
|
||
func Test_IsZeroOfUnderlyingType(t *testing.T) { | ||
for k, tc := range []struct { | ||
in interface{} | ||
zero bool | ||
}{ | ||
{in: nil, zero: true}, | ||
{in: 0, zero: true}, | ||
{in: 1, zero: false}, | ||
{in: false, zero: true}, | ||
{in: "", zero: true}, | ||
{in: interface{}(nil), zero: true}, | ||
{in: uuid.NullUUID{}, zero: true}, | ||
{in: uuid.UUID{}, zero: true}, | ||
{in: uuid.NullUUID{Valid: true}, zero: false}, | ||
{in: nulls.Int{}, zero: true}, | ||
{in: nulls.String{}, zero: true}, | ||
{in: nulls.Bool{}, zero: true}, | ||
{in: nulls.Float64{}, zero: true}, | ||
{in: sql.NullString{}, zero: true}, | ||
{in: sql.NullString{Valid: true}, zero: false}, | ||
} { | ||
t.Run(fmt.Sprintf("case=%d", k), func(t *testing.T) { | ||
assert.EqualValues(t, tc.zero, IsZeroOfUnderlyingType(tc.in)) | ||
}) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is used.