You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

124 lines
4.5 KiB

  1. name: "go: build dev binaries"
  2. on:
  3. push:
  4. branches: [ master ]
  5. permissions:
  6. contents: read
  7. jobs:
  8. cleanup:
  9. permissions:
  10. contents: write # for mknejp/delete-release-assets to delete release assets
  11. runs-on: ubuntu-latest
  12. steps:
  13. - name: Delete old release assets
  14. uses: mknejp/delete-release-assets@v1
  15. with:
  16. token: ${{ github.token }}
  17. tag: dev
  18. fail-if-no-assets: false
  19. assets: |
  20. weed-*
  21. build_dev_linux_windows:
  22. permissions:
  23. contents: write # for wangyoucao577/go-release-action to upload release assets
  24. needs: cleanup
  25. runs-on: ubuntu-latest
  26. strategy:
  27. matrix:
  28. goos: [linux, windows]
  29. goarch: [amd64]
  30. steps:
  31. - name: Check out code into the Go module directory
  32. uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v2
  33. - name: Set BUILD_TIME env
  34. run: echo BUILD_TIME=$(date -u +%Y%m%d-%H%M) >> ${GITHUB_ENV}
  35. - name: Go Release Binaries Large Disk
  36. uses: wangyoucao577/go-release-action@b173bce0484dc9f34c585181e5db16bd8756a21e # v1.22
  37. with:
  38. github_token: ${{ secrets.GITHUB_TOKEN }}
  39. goos: ${{ matrix.goos }}
  40. goarch: ${{ matrix.goarch }}
  41. release_tag: dev
  42. overwrite: true
  43. pre_command: export CGO_ENABLED=0 && export GODEBUG=http2client=0
  44. build_flags: -tags 5BytesOffset # optional, default is
  45. ldflags: -s -w -extldflags -static -X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=${{github.sha}}
  46. # Where to run `go build .`
  47. project_path: weed
  48. binary_name: weed-large-disk
  49. asset_name: "weed-large-disk-${{ env.BUILD_TIME }}-${{ matrix.goos }}-${{ matrix.goarch }}"
  50. - name: Go Release Binaries Normal Volume Size
  51. uses: wangyoucao577/go-release-action@b173bce0484dc9f34c585181e5db16bd8756a21e # v1.22
  52. with:
  53. github_token: ${{ secrets.GITHUB_TOKEN }}
  54. goos: ${{ matrix.goos }}
  55. goarch: ${{ matrix.goarch }}
  56. release_tag: dev
  57. overwrite: true
  58. pre_command: export CGO_ENABLED=0 && export GODEBUG=http2client=0
  59. ldflags: -s -w -extldflags -static -X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=${{github.sha}}
  60. # Where to run `go build .`
  61. project_path: weed
  62. binary_name: weed-normal-disk
  63. asset_name: "weed-${{ env.BUILD_TIME }}-${{ matrix.goos }}-${{ matrix.goarch }}"
  64. build_dev_darwin:
  65. permissions:
  66. contents: write # for wangyoucao577/go-release-action to upload release assets
  67. needs: build_dev_linux_windows
  68. runs-on: ubuntu-latest
  69. strategy:
  70. matrix:
  71. goos: [darwin]
  72. goarch: [amd64, arm64]
  73. steps:
  74. - name: Check out code into the Go module directory
  75. uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v2
  76. - name: Set BUILD_TIME env
  77. run: echo BUILD_TIME=$(date -u +%Y%m%d-%H%M) >> ${GITHUB_ENV}
  78. - name: Go Release Binaries Large Disk
  79. uses: wangyoucao577/go-release-action@b173bce0484dc9f34c585181e5db16bd8756a21e # v1.22
  80. with:
  81. github_token: ${{ secrets.GITHUB_TOKEN }}
  82. goos: ${{ matrix.goos }}
  83. goarch: ${{ matrix.goarch }}
  84. release_tag: dev
  85. overwrite: true
  86. pre_command: export CGO_ENABLED=0 && export GODEBUG=http2client=0
  87. build_flags: -tags 5BytesOffset # optional, default is
  88. ldflags: -s -w -extldflags -static -X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=${{github.sha}}
  89. # Where to run `go build .`
  90. project_path: weed
  91. binary_name: weed-large-disk
  92. asset_name: "weed-large-disk-${{ env.BUILD_TIME }}-${{ matrix.goos }}-${{ matrix.goarch }}"
  93. - name: Go Release Binaries Normal Volume Size
  94. uses: wangyoucao577/go-release-action@b173bce0484dc9f34c585181e5db16bd8756a21e # v1.22
  95. with:
  96. github_token: ${{ secrets.GITHUB_TOKEN }}
  97. goos: ${{ matrix.goos }}
  98. goarch: ${{ matrix.goarch }}
  99. release_tag: dev
  100. overwrite: true
  101. pre_command: export CGO_ENABLED=0 && export GODEBUG=http2client=0
  102. ldflags: -s -w -extldflags -static -X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=${{github.sha}}
  103. # Where to run `go build .`
  104. project_path: weed
  105. binary_name: weed-normal-disk
  106. asset_name: "weed-${{ env.BUILD_TIME }}-${{ matrix.goos }}-${{ matrix.goarch }}"