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.

125 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@a8aaab13272b1eaac16cc46dddd3f725b97ee05a # 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@629c2de402a417ea7690ca6ce3f33229e27606a5 # 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@16624612d4e2b73de613857a362d294700207fff # 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: -extldflags -static -X github.com/chrislusf/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@16624612d4e2b73de613857a362d294700207fff # 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: -extldflags -static -X github.com/chrislusf/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. goarch: [amd64]
  74. steps:
  75. - name: Check out code into the Go module directory
  76. uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
  77. - name: Set BUILD_TIME env
  78. run: echo BUILD_TIME=$(date -u +%Y%m%d-%H%M) >> ${GITHUB_ENV}
  79. - name: Go Release Binaries Large Disk
  80. uses: wangyoucao577/go-release-action@16624612d4e2b73de613857a362d294700207fff # v1.22
  81. with:
  82. github_token: ${{ secrets.GITHUB_TOKEN }}
  83. goos: ${{ matrix.goos }}
  84. goarch: ${{ matrix.goarch }}
  85. release_tag: dev
  86. overwrite: true
  87. pre_command: export CGO_ENABLED=0 && export GODEBUG=http2client=0
  88. build_flags: -tags 5BytesOffset # optional, default is
  89. ldflags: -extldflags -static -X github.com/chrislusf/seaweedfs/weed/util.COMMIT=${{github.sha}}
  90. # Where to run `go build .`
  91. project_path: weed
  92. binary_name: weed-large-disk
  93. asset_name: "weed-large-disk-${{ env.BUILD_TIME }}-${{ matrix.goos }}-${{ matrix.goarch }}"
  94. - name: Go Release Binaries Normal Volume Size
  95. uses: wangyoucao577/go-release-action@16624612d4e2b73de613857a362d294700207fff # v1.22
  96. with:
  97. github_token: ${{ secrets.GITHUB_TOKEN }}
  98. goos: ${{ matrix.goos }}
  99. goarch: ${{ matrix.goarch }}
  100. release_tag: dev
  101. overwrite: true
  102. pre_command: export CGO_ENABLED=0 && export GODEBUG=http2client=0
  103. ldflags: -extldflags -static -X github.com/chrislusf/seaweedfs/weed/util.COMMIT=${{github.sha}}
  104. # Where to run `go build .`
  105. project_path: weed
  106. binary_name: weed-normal-disk
  107. asset_name: "weed-${{ env.BUILD_TIME }}-${{ matrix.goos }}-${{ matrix.goarch }}"