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