deb.yml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. name: Build debian packages
  2. on:
  3. push:
  4. branches:
  5. - master
  6. - v*
  7. pull_request:
  8. types: [opened, synchronize, reopened]
  9. paths:
  10. - ".github/workflows/deb.yml"
  11. release:
  12. types: [prereleased]
  13. jobs:
  14. package:
  15. if: github.repository == 'v2fly/v2ray-core'
  16. runs-on: ubuntu-latest
  17. container: debian:sid
  18. steps:
  19. - name: Install git
  20. run: |
  21. apt-get update
  22. apt-get install -y git wget
  23. - name: Checkout codebase
  24. uses: actions/checkout@v2
  25. with:
  26. submodules: "recursive"
  27. - name: Download geo files
  28. run: |
  29. wget -O release/config/geoip.dat "https://raw.githubusercontent.com/v2fly/geoip/release/geoip.dat"
  30. wget -O release/config/geosite.dat "https://raw.githubusercontent.com/v2fly/domain-list-community/release/dlc.dat"
  31. - name: Install build dependencies
  32. run: |
  33. apt-get install -y build-essential dh-golang golang-any reprepro
  34. - name: Build
  35. run: |
  36. cp -r release/debian .
  37. dpkg-buildpackage -us -uc -i -b
  38. - name: Copy binary
  39. run: |
  40. cp ../*.deb ./
  41. - name: Upload artifact
  42. uses: actions/upload-artifact@v2
  43. with:
  44. name: v2ray-debian-packages
  45. path: ./*.deb
  46. - name: Setup Repository
  47. if: github.event_name == 'release'
  48. run: |
  49. git clone https://github.com/v2fly/debian.git archive
  50. echo ${{ secrets.DEBIAN_GPG_PRIVATE }} | base64 -d > private.key
  51. gpg --import --batch private.key
  52. gpg -K
  53. cd archive
  54. git config --local user.name "${{ github.actor }}"
  55. git config --local user.email "${{ github.actor }}@users.noreply.github.com"
  56. git remote set-url origin https://${{ github.actor }}:${{ secrets.DEBIAN_REPO_TOKEN }}@github.com/v2fly/debian.git
  57. reprepro includedeb stable ../*.deb
  58. git add -A
  59. git commit -am 'update'
  60. git push origin main