deb.yml 1.5 KB

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