deb.yml 1.6 KB

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