2020-11-07 22:10:13 -05:00
|
|
|
name: Build debian packages
|
|
|
|
|
|
|
|
on:
|
2021-05-04 22:34:12 -04:00
|
|
|
workflow_dispatch:
|
2020-11-07 22:10:13 -05:00
|
|
|
push:
|
2020-11-23 07:51:58 -05:00
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- v*
|
2021-05-10 18:24:35 -04:00
|
|
|
paths:
|
|
|
|
- ".github/workflows/deb.yml"
|
|
|
|
- "release/debian/*"
|
2021-04-06 15:41:27 -04:00
|
|
|
pull_request:
|
|
|
|
types: [opened, synchronize, reopened]
|
|
|
|
paths:
|
|
|
|
- ".github/workflows/deb.yml"
|
2021-04-12 11:14:26 -04:00
|
|
|
- "release/debian/*"
|
2020-11-07 22:10:13 -05:00
|
|
|
release:
|
|
|
|
types: [prereleased]
|
|
|
|
|
|
|
|
jobs:
|
2020-11-26 19:33:44 -05:00
|
|
|
package:
|
2020-11-08 23:28:26 -05:00
|
|
|
if: github.repository == 'v2fly/v2ray-core'
|
2020-11-07 22:10:13 -05:00
|
|
|
runs-on: ubuntu-latest
|
2022-09-17 20:46:32 -04:00
|
|
|
container: golang:1.19-bullseye
|
2020-11-07 22:10:13 -05:00
|
|
|
|
|
|
|
steps:
|
2021-09-20 18:59:21 -04:00
|
|
|
- name: Update & install dependencies
|
2020-11-07 22:10:13 -05:00
|
|
|
run: |
|
|
|
|
apt-get update
|
2021-04-06 15:41:27 -04:00
|
|
|
apt-get install -y git wget
|
2020-11-08 23:28:26 -05:00
|
|
|
|
|
|
|
- name: Checkout codebase
|
2022-03-02 00:10:12 -05:00
|
|
|
uses: actions/checkout@v3
|
2020-11-08 23:28:26 -05:00
|
|
|
|
2021-04-06 15:20:51 -04:00
|
|
|
- name: Download geo files
|
|
|
|
run: |
|
|
|
|
wget -O release/config/geoip.dat "https://raw.githubusercontent.com/v2fly/geoip/release/geoip.dat"
|
2021-08-26 00:46:14 -04:00
|
|
|
wget -O release/config/geoip-only-cn-private.dat "https://raw.githubusercontent.com/v2fly/geoip/release/geoip-only-cn-private.dat"
|
2021-04-06 15:20:51 -04:00
|
|
|
wget -O release/config/geosite.dat "https://raw.githubusercontent.com/v2fly/domain-list-community/release/dlc.dat"
|
|
|
|
|
2020-11-07 22:10:13 -05:00
|
|
|
- name: Install build dependencies
|
|
|
|
run: |
|
2021-09-20 18:59:21 -04:00
|
|
|
apt-get install -y build-essential dh-golang reprepro
|
2020-11-08 23:28:26 -05:00
|
|
|
|
2020-11-07 22:10:13 -05:00
|
|
|
- name: Build
|
|
|
|
run: |
|
2021-04-12 00:07:04 -04:00
|
|
|
echo "PATH=${PATH}"
|
2020-11-07 22:10:13 -05:00
|
|
|
cp -r release/debian .
|
2021-04-12 00:07:04 -04:00
|
|
|
dpkg-buildpackage -us -uc -i -b -d
|
2020-11-08 23:28:26 -05:00
|
|
|
|
2020-11-07 22:10:13 -05:00
|
|
|
- name: Copy binary
|
|
|
|
run: |
|
|
|
|
cp ../*.deb ./
|
2020-11-08 23:28:26 -05:00
|
|
|
|
2020-11-07 22:10:13 -05:00
|
|
|
- name: Upload artifact
|
2022-04-09 05:42:04 -04:00
|
|
|
uses: actions/upload-artifact@v3
|
2020-11-07 22:10:13 -05:00
|
|
|
with:
|
|
|
|
name: v2ray-debian-packages
|
|
|
|
path: ./*.deb
|
2020-11-08 23:28:26 -05:00
|
|
|
|
2020-11-07 22:24:18 -05:00
|
|
|
- name: Setup Repository
|
2021-05-04 22:34:12 -04:00
|
|
|
if: ${{ github.event_name == 'release' || github.event_name == 'workflow_dispatch' }}
|
2020-11-07 22:24:18 -05:00
|
|
|
run: |
|
|
|
|
git clone https://github.com/v2fly/debian.git archive
|
2020-11-20 10:41:48 -05:00
|
|
|
echo ${{ secrets.DEBIAN_GPG_PRIVATE }} | base64 -d > private.key
|
2020-11-21 09:40:27 -05:00
|
|
|
gpg --import --batch private.key
|
|
|
|
gpg -K
|
2020-11-07 22:24:18 -05:00
|
|
|
cd archive
|
|
|
|
git config --local user.name "${{ github.actor }}"
|
|
|
|
git config --local user.email "${{ github.actor }}@users.noreply.github.com"
|
|
|
|
git remote set-url origin https://${{ github.actor }}:${{ secrets.DEBIAN_REPO_TOKEN }}@github.com/v2fly/debian.git
|
2020-11-09 09:52:37 -05:00
|
|
|
reprepro includedeb stable ../*.deb
|
2020-11-07 22:24:18 -05:00
|
|
|
git add -A
|
|
|
|
git commit -am 'update'
|
2020-11-07 22:27:14 -05:00
|
|
|
git push origin main
|