diff options
| author | hilimd <68371223+hilimd@users.noreply.github.com> | 2021-09-13 10:34:33 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-13 10:34:33 +0800 |
| commit | 1de733fda507e1da94b2e4741c74ba7e5e2c5f76 (patch) | |
| tree | aed7ac29e27e0f8def942154603375396fae9489 /.github | |
| parent | 27c05f8c0b5c7bda43babeb61d79684d11851111 (diff) | |
| parent | 7591336a2269c1ad92266280634bcaea34f7a5d1 (diff) | |
| download | seaweedfs-1de733fda507e1da94b2e4741c74ba7e5e2c5f76.tar.xz seaweedfs-1de733fda507e1da94b2e4741c74ba7e5e2c5f76.zip | |
Merge pull request #81 from chrislusf/master
sync
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/binaries_dev.yml | 62 | ||||
| -rw-r--r-- | .github/workflows/binaries_release.yml | 63 | ||||
| -rw-r--r-- | .github/workflows/cleanup.yml | 22 | ||||
| -rw-r--r-- | .github/workflows/container_dev.yml | 63 | ||||
| -rw-r--r-- | .github/workflows/container_latest.yml | 65 | ||||
| -rw-r--r-- | .github/workflows/container_release.yml | 17 | ||||
| -rw-r--r-- | .github/workflows/go.yml | 6 | ||||
| -rw-r--r-- | .github/workflows/release.yml | 66 |
8 files changed, 210 insertions, 154 deletions
diff --git a/.github/workflows/binaries_dev.yml b/.github/workflows/binaries_dev.yml new file mode 100644 index 000000000..ac804df9c --- /dev/null +++ b/.github/workflows/binaries_dev.yml @@ -0,0 +1,62 @@ +name: "go: build dev binaries" + +on: + push: + branches: [ master ] + +jobs: + + + build-latest-docker-image: + runs-on: [ubuntu-latest] + + steps: + - + name: Checkout + uses: actions/checkout@v2 + - + name: Docker meta + id: docker_meta + uses: docker/metadata-action@v3 + with: + images: | + chrislusf/seaweedfs + ghcr.io/chrislusf/seaweedfs + tags: | + type=raw,value=latest + labels: | + org.opencontainers.image.title=seaweedfs + org.opencontainers.image.vendor=Chris Lu + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + with: + buildkitd-flags: "--debug" + - + name: Login to Docker Hub + if: github.event_name != 'pull_request' + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - + name: Login to GHCR + if: github.event_name != 'pull_request' + 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 }} diff --git a/.github/workflows/binaries_release.yml b/.github/workflows/binaries_release.yml new file mode 100644 index 000000000..a093f0a3e --- /dev/null +++ b/.github/workflows/binaries_release.yml @@ -0,0 +1,63 @@ +# This is a basic workflow to help you get started with Actions + +name: "go: build versioned binaries" + +on: + push: + tags: + - '*' + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + + build-release-binaries: + 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 represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + - name: Go Release Binaries Normal Volume Size + uses: wangyoucao577/go-release-action@v1.20 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + goos: ${{ matrix.goos }} + goarch: ${{ matrix.goarch }} + overwrite: true + pre_command: export CGO_ENABLED=0 + # build_flags: -tags 5BytesOffset # optional, default is + ldflags: -extldflags -static -X github.com/chrislusf/seaweedfs/weed/util.COMMIT=${{github.sha}} + # Where to run `go build .` + project_path: weed + binary_name: weed + asset_name: "${{ matrix.goos }}_${{ matrix.goarch }}" + - name: Go Release Large Disk Binaries + uses: wangyoucao577/go-release-action@v1.20 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + goos: ${{ matrix.goos }} + goarch: ${{ matrix.goarch }} + overwrite: true + pre_command: export CGO_ENABLED=0 + build_flags: -tags 5BytesOffset # optional, default is + ldflags: -extldflags -static -X github.com/chrislusf/seaweedfs/weed/util.COMMIT=${{github.sha}} + # Where to run `go build .` + project_path: weed + binary_name: weed + asset_name: "${{ matrix.goos }}_${{ matrix.goarch }}_large_disk" diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml deleted file mode 100644 index 47a677e6d..000000000 --- a/.github/workflows/cleanup.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Cleanup - -on: - push: - branches: [ master ] - -jobs: - - build: - name: Build - runs-on: ubuntu-latest - - steps: - - - name: Delete old release assets - uses: mknejp/delete-release-assets@v1 - with: - token: ${{ github.token }} - tag: dev - fail-if-no-assets: false - assets: | - weed-* diff --git a/.github/workflows/container_dev.yml b/.github/workflows/container_dev.yml new file mode 100644 index 000000000..0261275fe --- /dev/null +++ b/.github/workflows/container_dev.yml @@ -0,0 +1,63 @@ +name: "docker: build dev containers" + +on: + push: + branches: [ master ] + workflow_dispatch: [] + +jobs: + + build-dev-containers: + runs-on: [ubuntu-latest] + + steps: + - + name: Checkout + uses: actions/checkout@v2 + - + name: Docker meta + id: docker_meta + uses: docker/metadata-action@v3 + with: + images: | + chrislusf/seaweedfs + ghcr.io/chrislusf/seaweedfs + tags: | + type=raw,value=dev + labels: | + org.opencontainers.image.title=seaweedfs + org.opencontainers.image.description=SeaweedFS is a distributed storage system for blobs, objects, files, and data lake, to store and serve billions of files fast! + org.opencontainers.image.vendor=Chris Lu + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + with: + buildkitd-flags: "--debug" + - + name: Login to Docker Hub + if: github.event_name != 'pull_request' + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - + name: Login to GHCR + if: github.event_name != 'pull_request' + 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.go_build + platforms: linux/amd64, linux/arm, linux/arm64, linux/386 + tags: ${{ steps.docker_meta.outputs.tags }} + labels: ${{ steps.docker_meta.outputs.labels }} diff --git a/.github/workflows/container_latest.yml b/.github/workflows/container_latest.yml index e4b3c2a38..1b9e9df54 100644 --- a/.github/workflows/container_latest.yml +++ b/.github/workflows/container_latest.yml @@ -1,66 +1,15 @@ -name: Build Latest Containers +name: "docker: build latest container" + on: push: - branches: - - master + branches: [ master ] workflow_dispatch: [] jobs: - build-latest: - runs-on: [ubuntu-latest] - steps: - - - name: Checkout - uses: actions/checkout@v2 - - - name: Docker meta - id: docker_meta - uses: crazy-max/ghaction-docker-meta@v2 - with: - images: | - chrislusf/seaweedfs - ghcr.io/chrislusf/seaweedfs - tags: | - type=raw,value=latest - labels: | - org.opencontainers.image.title=seaweedfs - org.opencontainers.image.vendor=Chris Lu - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - with: - buildkitd-flags: "--debug" - - - name: Login to Docker Hub - if: github.event_name != 'pull_request' - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Login to GHCR - if: github.event_name != 'pull_request' - 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 - tags: ${{ steps.docker_meta.outputs.tags }} - labels: ${{ steps.docker_meta.outputs.labels }} - build-dev: + build-latest-container: runs-on: [ubuntu-latest] + steps: - name: Checkout @@ -68,7 +17,7 @@ jobs: - name: Docker meta id: docker_meta - uses: crazy-max/ghaction-docker-meta@v2 + uses: docker/metadata-action@v3 with: images: | chrislusf/seaweedfs @@ -109,6 +58,6 @@ jobs: context: ./docker push: ${{ github.event_name != 'pull_request' }} file: ./docker/Dockerfile.go_build - platforms: linux/amd64 + platforms: linux/amd64, linux/arm, linux/arm64, linux/386 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 1ade0878e..625ab53cf 100644 --- a/.github/workflows/container_release.yml +++ b/.github/workflows/container_release.yml @@ -1,4 +1,5 @@ -name: Build Release Containers +name: "docker: build release containers" + on: push: tags: @@ -6,8 +7,9 @@ on: workflow_dispatch: [] jobs: - build-default: + build-default-release-container: runs-on: [ubuntu-latest] + steps: - name: Checkout @@ -15,7 +17,7 @@ jobs: - name: Docker meta id: docker_meta - uses: crazy-max/ghaction-docker-meta@v2 + uses: docker/metadata-action@v3 with: images: | chrislusf/seaweedfs @@ -58,11 +60,12 @@ jobs: context: ./docker push: ${{ github.event_name != 'pull_request' }} file: ./docker/Dockerfile.go_build - platforms: linux/amd64 + platforms: linux/amd64, linux/arm, linux/arm64, linux/386 tags: ${{ steps.docker_meta.outputs.tags }} labels: ${{ steps.docker_meta.outputs.labels }} - build-large: + build-large-release-container: runs-on: [ubuntu-latest] + steps: - name: Checkout @@ -70,7 +73,7 @@ jobs: - name: Docker meta id: docker_meta - uses: crazy-max/ghaction-docker-meta@v2 + uses: docker/metadata-action@v3 with: images: | chrislusf/seaweedfs @@ -113,6 +116,6 @@ jobs: context: ./docker push: ${{ github.event_name != 'pull_request' }} file: ./docker/Dockerfile.go_build_large - platforms: linux/amd64 + platforms: linux/amd64, linux/arm, linux/arm64, linux/386 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..2ce5f7954 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,4 +1,4 @@ -name: Go +name: "go: build binary" on: push: @@ -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 deleted file mode 100644 index 828396230..000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: Release - -on: - push: - branches: [ master ] - -jobs: - - build: - name: Build - runs-on: ubuntu-latest - strategy: - matrix: - goos: [linux, windows, darwin, freebsd ] - goarch: [amd64, arm] - exclude: - - goarch: arm - goos: darwin - - goarch: arm - goos: windows - - steps: - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Wait for the deletion - uses: jakejarvis/wait-action@master - with: - time: '30s' - - - name: Set BUILD_TIME env - run: echo BUILD_TIME=$(date -u +%Y%m%d-%H%M) >> ${GITHUB_ENV} - - - name: Go Release Binaries - uses: wangyoucao577/go-release-action@v1.17 - with: - goversion: 1.16 - github_token: ${{ secrets.GITHUB_TOKEN }} - goos: ${{ matrix.goos }} - goarch: ${{ matrix.goarch }} - release_tag: dev - overwrite: true - pre_command: export CGO_ENABLED=0 - build_flags: -tags 5BytesOffset # optional, default is - ldflags: -extldflags -static -X github.com/chrislusf/seaweedfs/weed/util.COMMIT=${{github.sha}} - # Where to run `go build .` - project_path: weed - binary_name: weed-large-disk - asset_name: "weed-large-disk-${{ env.BUILD_TIME }}-${{ matrix.goos }}-${{ matrix.goarch }}" - - - name: Go Release Binaries - uses: wangyoucao577/go-release-action@v1.17 - with: - goversion: 1.16 - github_token: ${{ secrets.GITHUB_TOKEN }} - goos: ${{ matrix.goos }} - goarch: ${{ matrix.goarch }} - release_tag: dev - overwrite: true - pre_command: export CGO_ENABLED=0 - ldflags: -extldflags -static -X github.com/chrislusf/seaweedfs/weed/util.COMMIT=${{github.sha}} - # Where to run `go build .` - project_path: weed - binary_name: weed - asset_name: "weed-${{ env.BUILD_TIME }}-${{ matrix.goos }}-${{ matrix.goarch }}" |
