deb.yml 1.7 KB

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