aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chrislusf@users.noreply.github.com>2021-08-27 20:00:14 -0700
committerGitHub <noreply@github.com>2021-08-27 20:00:14 -0700
commitca80199ccd97aec58580b35fdfb3cdbcb35c91e9 (patch)
treea19b4d296f8fa60c708502350ca2472c6faca87c
parentdded814a6298ede88b7f1eb2e1d630c94934e0b1 (diff)
parent7b56a6400d12ae0f1693d0a0b2d46128544cdca4 (diff)
downloadseaweedfs-ca80199ccd97aec58580b35fdfb3cdbcb35c91e9.tar.xz
seaweedfs-ca80199ccd97aec58580b35fdfb3cdbcb35c91e9.zip
Merge pull request #2288 from logband/master
feature(cross-platform): add multi-arch support to release
-rw-r--r--.github/workflows/binary_test.yml51
-rw-r--r--.github/workflows/container_latest.yml14
-rw-r--r--.github/workflows/container_release.yml15
-rw-r--r--.github/workflows/container_test.yml12
-rw-r--r--.github/workflows/go.yml4
-rw-r--r--.github/workflows/release.yml6
-rw-r--r--.github/workflows/release_binaries.yml8
-rw-r--r--docker/Dockerfile4
8 files changed, 103 insertions, 11 deletions
diff --git a/.github/workflows/binary_test.yml b/.github/workflows/binary_test.yml
new file mode 100644
index 000000000..288abc848
--- /dev/null
+++ b/.github/workflows/binary_test.yml
@@ -0,0 +1,51 @@
+name: Cross-platform binary build test
+
+on:
+ push:
+ pull_request:
+ workflow_dispatch: []
+
+jobs:
+
+ build:
+ name: Build
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ goos: [linux, windows, darwin, freebsd, netbsd, openbsd]
+ goarch: [amd64, arm, arm64, 386]
+ exclude:
+ - goarch: arm
+ goos: darwin
+ - goarch: 386
+ goos: darwin
+ - goarch: arm
+ goos: windows
+ - goarch: arm64
+ goos: windows
+
+ concurrency:
+ group: ${{ github.head_ref }}/binary_test/${{ matrix.goos }}/${{ matrix.goarch }}
+ cancel-in-progress: true
+
+ steps:
+
+ - name: Set up Go 1.x
+ uses: actions/setup-go@v2
+ with:
+ go-version: ^1.13
+ id: go
+
+ - name: Check out code into the Go module directory
+ uses: actions/checkout@v2
+
+ - name: Get dependencies
+ run: |
+ cd weed; go get -v -t -d ./...
+ if [ -f Gopkg.toml ]; then
+ curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
+ dep ensure
+ fi
+
+ - name: Build
+ run: cd weed; GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -v .
diff --git a/.github/workflows/container_latest.yml b/.github/workflows/container_latest.yml
index b55922df9..6536805db 100644
--- a/.github/workflows/container_latest.yml
+++ b/.github/workflows/container_latest.yml
@@ -8,6 +8,11 @@ on:
jobs:
build-latest:
runs-on: [ubuntu-latest]
+ strategy:
+ matrix:
+ platform: [ linux ]
+ arch: [ amd64, arm, arm64, 386 ]
+
steps:
-
name: Checkout
@@ -55,12 +60,17 @@ jobs:
context: ./docker
push: ${{ github.event_name != 'pull_request' }}
file: ./docker/Dockerfile
- platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6
+ platforms: ${{ matrix.platform }}/${{ matrix.arch }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
build-dev:
runs-on: [ubuntu-latest]
+ strategy:
+ matrix:
+ platform: [ linux ]
+ arch: [ amd64, arm, arm64, 386 ]
+
steps:
-
name: Checkout
@@ -109,6 +119,6 @@ jobs:
context: ./docker
push: ${{ github.event_name != 'pull_request' }}
file: ./docker/Dockerfile.go_build
- platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6
+ platforms: ${{ matrix.platform }}/${{ matrix.arch }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
diff --git a/.github/workflows/container_release.yml b/.github/workflows/container_release.yml
index 1b155b7bd..a0cbbbb68 100644
--- a/.github/workflows/container_release.yml
+++ b/.github/workflows/container_release.yml
@@ -1,4 +1,5 @@
name: Build Release Containers
+
on:
push:
tags:
@@ -8,6 +9,11 @@ on:
jobs:
build-default:
runs-on: [ubuntu-latest]
+ strategy:
+ matrix:
+ platform: [ linux ]
+ arch: [ amd64, arm, arm64, 386 ]
+
steps:
-
name: Checkout
@@ -58,11 +64,16 @@ jobs:
context: ./docker
push: ${{ github.event_name != 'pull_request' }}
file: ./docker/Dockerfile.go_build
- platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6
+ platforms: ${{ matrix.platform }}/${{ matrix.arch }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
build-large:
runs-on: [ubuntu-latest]
+ strategy:
+ matrix:
+ platform: [ linux ]
+ arch: [ amd64, arm, arm64, 386 ]
+
steps:
-
name: Checkout
@@ -113,6 +124,6 @@ jobs:
context: ./docker
push: ${{ github.event_name != 'pull_request' }}
file: ./docker/Dockerfile.go_build_large
- platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6
+ platforms: ${{ matrix.platform }}/${{ matrix.arch }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
diff --git a/.github/workflows/container_test.yml b/.github/workflows/container_test.yml
index dbb542e54..410d1d21a 100644
--- a/.github/workflows/container_test.yml
+++ b/.github/workflows/container_test.yml
@@ -1,12 +1,22 @@
name: Test Building Container Images
+
on:
push:
pull_request:
workflow_dispatch: []
+concurrency:
+ group: ${{ github.head_ref }}/container_test
+ cancel-in-progress: true
+
jobs:
build-test:
runs-on: [ubuntu-latest]
+ strategy:
+ matrix:
+ platform: [ linux ]
+ arch: [ amd64, arm, arm64, 386 ]
+
steps:
-
name: Checkout
@@ -39,6 +49,6 @@ jobs:
context: ./docker
push: ${{ github.event_name != 'pull_request' }}
file: ./docker/Dockerfile
- platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6
+ platforms: ${{ matrix.platform }}/${{ matrix.arch }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
index b2948a0b7..d6f7bf1b9 100644
--- a/.github/workflows/go.yml
+++ b/.github/workflows/go.yml
@@ -6,6 +6,10 @@ on:
pull_request:
branches: [ master ]
+concurrency:
+ group: ${{ github.head_ref }}/go
+ cancel-in-progress: true
+
jobs:
build:
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 41ac40dc2..e1105e5d9 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -11,17 +11,17 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- goos: [linux, windows, darwin, freebsd, netbsd, openbsd ]
+ goos: [linux, windows, darwin, freebsd, netbsd, openbsd]
goarch: [amd64, arm, arm64, 386]
exclude:
- goarch: arm
goos: darwin
- goarch: 386
goos: darwin
- - goarch: arm64
- goos: windows
- goarch: arm
goos: windows
+ - goarch: arm64
+ goos: windows
steps:
diff --git a/.github/workflows/release_binaries.yml b/.github/workflows/release_binaries.yml
index ca3457c8b..9d44209f6 100644
--- a/.github/workflows/release_binaries.yml
+++ b/.github/workflows/release_binaries.yml
@@ -15,13 +15,17 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- goos: [linux, windows, darwin, freebsd ]
- goarch: [amd64, arm]
+ goos: [linux, windows, darwin, freebsd, netbsd, openbsd]
+ goarch: [amd64, arm, arm64, 386]
exclude:
- goarch: arm
goos: darwin
+ - goarch: 386
+ goos: darwin
- goarch: arm
goos: windows
+ - goarch: arm64
+ goos: windows
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
diff --git a/docker/Dockerfile b/docker/Dockerfile
index cf8eac251..d2c365c29 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -8,7 +8,9 @@ RUN \
elif [ $(uname -m) == "x86_64" ] && [ $(getconf LONG_BIT) == "32" ]; then echo "386"; \
elif [ $(uname -m) == "aarch64" ]; then echo "arm64"; \
elif [ $(uname -m) == "armv7l" ]; then echo "arm"; \
- elif [ $(uname -m) == "armv6l" ]; then echo "arm"; fi;) && \
+ elif [ $(uname -m) == "armv6l" ]; then echo "arm"; \
+ elif [ $(uname -m) == "s390x" ]; then echo "s390x"; \
+ elif [ $(uname -m) == "ppc64le" ]; then echo "ppc64le"; fi;) && \
echo "Building for $ARCH" 1>&2 && \
SUPERCRONIC_SHA1SUM=$(echo $ARCH | sed 's/386/e0126b0102b9f388ecd55714358e3ad60d0cebdb/g' | sed 's/amd64/5ddf8ea26b56d4a7ff6faecdd8966610d5cb9d85/g' | sed 's/arm64/e2714c43e7781bf1579c85aa61259245f56dbba1/g' | sed 's/arm/47481c3341bc3a1ae91a728e0cc63c8e6d3791ad/g') && \
SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.9/supercronic-linux-$ARCH && \