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. fail-if-no-release: false
  22. build_dev_linux_windows:
  23. permissions:
  24. contents: write # for wangyoucao577/go-release-action to upload release assets
  25. needs: cleanup
  26. runs-on: ubuntu-latest
  27. strategy:
  28. matrix:
  29. goos: [linux, windows]
  30. goarch: [amd64]
  31. steps:
  32. - name: Check out code into the Go module directory
  33. uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
  34. - name: Set BUILD_TIME env
  35. run: echo BUILD_TIME=$(date -u +%Y%m%d-%H%M) >> ${GITHUB_ENV}
  36. - name: Go Release Binaries Large Disk
  37. uses: wangyoucao577/go-release-action@16624612d4e2b73de613857a362d294700207fff # v1.22
  38. with:
  39. github_token: ${{ secrets.GITHUB_TOKEN }}
  40. goos: ${{ matrix.goos }}
  41. goarch: ${{ matrix.goarch }}
  42. release_tag: dev
  43. overwrite: true
  44. pre_command: export CGO_ENABLED=0 && export GODEBUG=http2client=0
  45. build_flags: -tags 5BytesOffset # optional, default is
  46. ldflags: -extldflags -static -X github.com/chrislusf/seaweedfs/weed/util.COMMIT=${{github.sha}}
  47. # Where to run `go build .`
  48. project_path: weed
  49. binary_name: weed-large-disk
  50. asset_name: "weed-large-disk-${{ env.BUILD_TIME }}-${{ matrix.goos }}-${{ matrix.goarch }}"
  51. - name: Go Release Binaries Normal Volume Size
  52. uses: wangyoucao577/go-release-action@16624612d4e2b73de613857a362d294700207fff # v1.22
  53. with:
  54. github_token: ${{ secrets.GITHUB_TOKEN }}
  55. goos: ${{ matrix.goos }}
  56. goarch: ${{ matrix.goarch }}
  57. release_tag: dev
  58. overwrite: true
  59. pre_command: export CGO_ENABLED=0 && export GODEBUG=http2client=0
  60. ldflags: -extldflags -static -X github.com/chrislusf/seaweedfs/weed/util.COMMIT=${{github.sha}}
  61. # Where to run `go build .`
  62. project_path: weed
  63. binary_name: weed-normal-disk
  64. asset_name: "weed-${{ env.BUILD_TIME }}-${{ matrix.goos }}-${{ matrix.goarch }}"
  65. build_dev_darwin:
  66. permissions:
  67. contents: write # for wangyoucao577/go-release-action to upload release assets
  68. needs: build_dev_linux_windows
  69. runs-on: ubuntu-latest
  70. strategy:
  71. matrix:
  72. goos: [darwin]
  73. goarch: [amd64, arm64]
  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 }}"