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

Add support for s390x architecture in GitHub Actions workflows. #337

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/image-build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: image-build-test
on: [push, pull_request]

env:
BUILD_PLATFORMS: linux/amd64,linux/arm64,linux/ppc64le
BUILD_PLATFORMS: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x

jobs:
build-image:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/image-push-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Push images on merge to main"

env:
IMAGE_NAME: ghcr.io/${{ github.repository }}-plugin
BUILD_PLATFORMS: linux/amd64,linux/arm64,linux/ppc64le
BUILD_PLATFORMS: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/image-push-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Push images on release"

env:
IMAGE_NAME: ghcr.io/${{ github.repository }}-plugin
BUILD_PLATFORMS: linux/amd64,linux/arm64,linux/ppc64le
BUILD_PLATFORMS: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x

on:
push:
Expand Down
3 changes: 2 additions & 1 deletion hack/install-go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

destination=$1
version=$(curl -s https://go.dev/dl/?mode=json | jq -r ".[0].version")
tarball=$version.linux-amd64.tar.gz
arch=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that required? IIUC the binaries for all platforms are cross-compiled on amd64?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.that's correct.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're asking why we use the sed command, here's the explanation:
The terms "x86_64" and "amd64" refer to the same architecture. However, the uname -m command returns "x86_64" to describe this architecture. On the other hand, the Go programming language uses the term "amd64" for this architecture. Therefore, to ensure consistency with Go and cross-compilation setups, we use the sed command to rename "x86_64" to "amd64".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I got that. Just asking if we need this change or if we can continue to cross compile on amd64.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need this change to build on s390x or other platforms.

tarball=$version.linux-$arch.tar.gz
url=https://dl.google.com/go/

mkdir -p $destination
Expand Down
Loading