deb.yml 1.6 KB

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