Skip to content

Commit b898a8b

Browse files
statikjoho
andauthored
Add darwin arm64 build (#174)
* Add darwin arm64 build Signed-off-by: Elliot Murphy <[email protected]> * update url for go version Signed-off-by: Elliot Murphy <[email protected]> Co-authored-by: John Barton <[email protected]>
1 parent 60df7dd commit b898a8b

File tree

2 files changed

+45
-3
lines changed

2 files changed

+45
-3
lines changed

.github/workflows/ci.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,46 @@ jobs:
1818
with:
1919
go-version: ${{ matrix.go }}
2020
- run: go test
21+
22+
test-non-amd64:
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
arch:
27+
# For some reasons this is segfaulting on go env
28+
# - name: IBM Z and LinuxONE
29+
# architecture: "s390x"
30+
- name: POWER8
31+
architecture: "ppc64le"
32+
33+
runs-on: ubuntu-latest
34+
name: Test on ${{ matrix.arch.name }}
35+
steps:
36+
- uses: actions/checkout@v2
37+
- uses: uraimo/run-on-arch-action@master
38+
with:
39+
arch: ${{ matrix.arch.architecture }}
40+
distro: ubuntu20.04
41+
env: | # YAML pipe
42+
GOARCH: ${{ matrix.arch.architecture }}
43+
CGO_ENABLED: 0
44+
GOPRIVATE: github.com/joho/godotenv
45+
run: |
46+
apt-get update
47+
apt-get install -q -y curl wget git
48+
latestGo=$(curl "https://go.dev/VERSION?m=text")
49+
wget "https://dl.google.com/go/${latestGo}.linux-${GOARCH}.tar.gz"
50+
rm -f $(which go)
51+
rm -rf /usr/local/go
52+
tar -C /usr/local -xzf "${latestGo}.linux-${GOARCH}.tar.gz"
53+
export PATH=/usr/local/go/bin:$PATH
54+
printf "Using go at: $(which go)\n"
55+
printf "Go version: $(go version)\n"
56+
printf "\n\nGo environment:\n\n"
57+
go env
58+
printf "\n\nSystem environment:\n\n"
59+
env
60+
go get -v -t -d ./...
61+
go test ./...
62+
cd ./cmd/godotenv
63+
go build -trimpath -ldflags="-w -s" -v

.github/workflows/release.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ jobs:
1313
- name: Checkout code
1414
uses: actions/checkout@v3
1515
- name: Generate build files
16-
uses: thatisuday/go-cross-build@v1
16+
uses: thatisuday/go-cross-build@v1.0.2
1717
with:
18-
platforms: 'linux/amd64, linux/ppc64le, darwin/amd64, windows/amd64'
18+
platforms: 'linux/amd64, linux/ppc64le, darwin/amd64, darwin/arm64, windows/amd64'
1919
package: 'cmd/godotenv'
2020
name: 'godotenv'
2121
compress: 'true'
@@ -29,4 +29,3 @@ jobs:
2929
file: dist/*
3030
file_glob: true
3131
overwrite: true
32-

0 commit comments

Comments
 (0)