Debian Codegraph @

.github/workflows/deb.yml

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