From d869a07cd2b2e9cc22e7e87f7f001be84712fe9c Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 5 Sep 2021 23:08:34 -0700 Subject: clean up --- .github/workflows/binaries_dev.yml | 68 +++++++++++++++++++ .github/workflows/binaries_release.yml | 116 +++++++++++++++++++++++++++++++++ .github/workflows/binary_test.yml | 50 -------------- .github/workflows/container_test.yml | 53 --------------- .github/workflows/release.yml | 68 ------------------- .github/workflows/release_binaries.yml | 116 --------------------------------- 6 files changed, 184 insertions(+), 287 deletions(-) create mode 100644 .github/workflows/binaries_dev.yml create mode 100644 .github/workflows/binaries_release.yml delete mode 100644 .github/workflows/binary_test.yml delete mode 100644 .github/workflows/container_test.yml delete mode 100644 .github/workflows/release.yml delete mode 100644 .github/workflows/release_binaries.yml (limited to '.github/workflows') diff --git a/.github/workflows/binaries_dev.yml b/.github/workflows/binaries_dev.yml new file mode 100644 index 000000000..ac04a85dc --- /dev/null +++ b/.github/workflows/binaries_dev.yml @@ -0,0 +1,68 @@ +name: "go: build dev binaries" + +on: + push: + branches: [ master ] + +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 + + 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.20 + with: + 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.20 + with: + 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 }}" diff --git a/.github/workflows/binaries_release.yml b/.github/workflows/binaries_release.yml new file mode 100644 index 000000000..4ce94b765 --- /dev/null +++ b/.github/workflows/binaries_release.yml @@ -0,0 +1,116 @@ +# This is a basic workflow to help you get started with Actions + +name: "go: build versioned binaries" + +on: + release: + types: [created] + + # 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, 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: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + - name: Go Release 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 }}" + - 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" + + 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, linux/386 + tags: ${{ steps.docker_meta.outputs.tags }} + labels: ${{ steps.docker_meta.outputs.labels }} diff --git a/.github/workflows/binary_test.yml b/.github/workflows/binary_test.yml deleted file mode 100644 index 8468555e3..000000000 --- a/.github/workflows/binary_test.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: "go: test building cross-platform binary" - -on: - 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_test.yml b/.github/workflows/container_test.yml deleted file mode 100644 index d86392af5..000000000 --- a/.github/workflows/container_test.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: "docker: test building container images" - -on: - 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 - 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: Build - uses: docker/build-push-action@v2 - with: - context: ./docker - push: false - file: ./docker/Dockerfile - platforms: ${{ matrix.platform }}/${{ matrix.arch }} - tags: ${{ steps.docker_meta.outputs.tags }} - labels: ${{ steps.docker_meta.outputs.labels }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index ac04a85dc..000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: "go: build dev binaries" - -on: - push: - branches: [ master ] - -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 - - 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.20 - with: - 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.20 - with: - 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 }}" diff --git a/.github/workflows/release_binaries.yml b/.github/workflows/release_binaries.yml deleted file mode 100644 index 4ce94b765..000000000 --- a/.github/workflows/release_binaries.yml +++ /dev/null @@ -1,116 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: "go: build versioned binaries" - -on: - release: - types: [created] - - # 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, 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: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - name: Go Release 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 }}" - - 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" - - 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, linux/386 - tags: ${{ steps.docker_meta.outputs.tags }} - labels: ${{ steps.docker_meta.outputs.labels }} -- cgit v1.2.3