1
0
Fork 0
mirror of https://github.com/chrislusf/seaweedfs synced 2024-09-17 14:30:40 +02:00

Merge pull request #2288 from logband/master

feature(cross-platform): add multi-arch support to release
This commit is contained in:
Chris Lu 2021-08-27 20:00:14 -07:00 committed by GitHub
commit ca80199ccd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 103 additions and 11 deletions

51
.github/workflows/binary_test.yml vendored Normal file
View file

@ -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 .

View file

@ -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 }}

View file

@ -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 }}

View file

@ -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 }}

View file

@ -6,6 +6,10 @@ on:
pull_request:
branches: [ master ]
concurrency:
group: ${{ github.head_ref }}/go
cancel-in-progress: true
jobs:
build:

View file

@ -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:

View file

@ -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:

View file

@ -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 && \