release.yml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. name: Release X-ui
  2. on:
  3. push:
  4. tags:
  5. - "*"
  6. workflow_dispatch:
  7. jobs:
  8. linuxamd64build:
  9. name: build x-ui amd64 version
  10. runs-on: ubuntu-20.04
  11. steps:
  12. - uses: actions/[email protected]
  13. - name: Set up Go
  14. uses: actions/[email protected]
  15. with:
  16. go-version: "stable"
  17. - name: build linux amd64 version
  18. run: |
  19. CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -o xui-release -v main.go
  20. mkdir x-ui
  21. cp xui-release x-ui/xui-release
  22. cp x-ui.service x-ui/x-ui.service
  23. cp x-ui.sh x-ui/x-ui.sh
  24. cd x-ui
  25. mv xui-release x-ui
  26. mkdir bin
  27. cd bin
  28. wget https://github.com/mhsanaei/Xray-core/releases/latest/download/Xray-linux-64.zip
  29. unzip Xray-linux-64.zip
  30. rm -f Xray-linux-64.zip geoip.dat geosite.dat iran.dat
  31. wget https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat
  32. wget https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat
  33. wget https://github.com/bootmortis/iran-hosted-domains/releases/latest/download/iran.dat
  34. mv xray xray-linux-amd64
  35. cd ..
  36. cd ..
  37. - name: package
  38. run: tar -zcvf x-ui-linux-amd64.tar.gz x-ui
  39. - name: upload
  40. uses: svenstaro/[email protected]
  41. with:
  42. repo_token: ${{ secrets.GITHUB_TOKEN }}
  43. tag: ${{ github.ref }}
  44. file: x-ui-linux-amd64.tar.gz
  45. asset_name: x-ui-linux-amd64.tar.gz
  46. prerelease: true
  47. overwrite: true
  48. linuxarm64build:
  49. name: build x-ui arm64 version
  50. runs-on: ubuntu-20.04
  51. steps:
  52. - uses: actions/[email protected]
  53. - name: Set up Go
  54. uses: actions/[email protected]
  55. with:
  56. go-version: "stable"
  57. - name: build linux arm64 version
  58. run: |
  59. sudo apt-get update
  60. sudo apt install gcc-aarch64-linux-gnu
  61. CGO_ENABLED=1 GOOS=linux GOARCH=arm64 CC=aarch64-linux-gnu-gcc go build -o xui-release -v main.go
  62. mkdir x-ui
  63. cp xui-release x-ui/xui-release
  64. cp x-ui.service x-ui/x-ui.service
  65. cp x-ui.sh x-ui/x-ui.sh
  66. cd x-ui
  67. mv xui-release x-ui
  68. mkdir bin
  69. cd bin
  70. wget https://github.com/mhsanaei/xray-core/releases/latest/download/Xray-linux-arm64-v8a.zip
  71. unzip Xray-linux-arm64-v8a.zip
  72. rm -f Xray-linux-arm64-v8a.zip geoip.dat geosite.dat iran.dat
  73. wget https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat
  74. wget https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat
  75. wget https://github.com/bootmortis/iran-hosted-domains/releases/latest/download/iran.dat
  76. mv xray xray-linux-arm64
  77. cd ..
  78. cd ..
  79. - name: package
  80. run: tar -zcvf x-ui-linux-arm64.tar.gz x-ui
  81. - name: upload
  82. uses: svenstaro/[email protected]
  83. with:
  84. repo_token: ${{ secrets.GITHUB_TOKEN }}
  85. tag: ${{ github.ref }}
  86. file: x-ui-linux-arm64.tar.gz
  87. asset_name: x-ui-linux-arm64.tar.gz
  88. prerelease: true
  89. overwrite: true