restore dev binaries building

This commit is contained in:
Chris Lu 2021-09-19 00:41:45 -07:00
parent 59dd271734
commit eab7cf4bd3

View file

@ -6,57 +6,72 @@ on:
jobs: jobs:
cleanup:
build-latest-docker-image: runs-on: ubuntu-latest
runs-on: [ubuntu-latest]
steps: steps:
-
name: Checkout - name: Delete old release assets
uses: mknejp/delete-release-assets@v1
with:
token: ${{ github.token }}
tag: dev
fail-if-no-assets: false
assets: |
weed-*
build_dev:
needs: cleanup
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, windows, darwin, freebsd]
goarch: [amd64, arm, arm64]
exclude:
- goarch: arm
goos: darwin
- goarch: 386
goos: darwin
- goarch: arm
goos: windows
- goarch: arm64
goos: windows
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2 uses: actions/checkout@v2
-
name: Docker meta - name: Set BUILD_TIME env
id: docker_meta run: echo BUILD_TIME=$(date -u +%Y%m%d-%H%M) >> ${GITHUB_ENV}
uses: docker/metadata-action@v3
- name: Go Release Binaries Large Disk
uses: wangyoucao577/go-release-action@v1.20
with: with:
images: | github_token: ${{ secrets.GITHUB_TOKEN }}
chrislusf/seaweedfs goos: ${{ matrix.goos }}
ghcr.io/chrislusf/seaweedfs goarch: ${{ matrix.goarch }}
tags: | release_tag: dev
type=raw,value=latest overwrite: true
labels: | pre_command: export CGO_ENABLED=0
org.opencontainers.image.title=seaweedfs build_flags: -tags 5BytesOffset # optional, default is
org.opencontainers.image.vendor=Chris Lu ldflags: -extldflags -static -X github.com/chrislusf/seaweedfs/weed/util.COMMIT=${{github.sha}}
- # Where to run `go build .`
name: Set up QEMU project_path: weed
uses: docker/setup-qemu-action@v1 binary_name: weed-large-disk
- asset_name: "weed-large-disk-${{ env.BUILD_TIME }}-${{ matrix.goos }}-${{ matrix.goarch }}"
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1 - name: Go Release Binaries Normal Volume Size
uses: wangyoucao577/go-release-action@v1.20
with: with:
buildkitd-flags: "--debug" github_token: ${{ secrets.GITHUB_TOKEN }}
- goos: ${{ matrix.goos }}
name: Login to Docker Hub goarch: ${{ matrix.goarch }}
if: github.event_name != 'pull_request' release_tag: dev
uses: docker/login-action@v1 overwrite: true
with: pre_command: export CGO_ENABLED=0
username: ${{ secrets.DOCKER_USERNAME }} ldflags: -extldflags -static -X github.com/chrislusf/seaweedfs/weed/util.COMMIT=${{github.sha}}
password: ${{ secrets.DOCKER_PASSWORD }} # Where to run `go build .`
- project_path: weed
name: Login to GHCR binary_name: weed-normal-disk
if: github.event_name != 'pull_request' asset_name: "weed-${{ env.BUILD_TIME }}-${{ matrix.goos }}-${{ matrix.goarch }}"
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_TOKEN }}
-
name: Build
uses: docker/build-push-action@v2
with:
context: ./docker
push: ${{ github.event_name != 'pull_request' }}
file: ./docker/Dockerfile
platforms: linux/amd64, linux/arm, linux/arm64
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}