1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-27 01:45:23 +00:00
v2fly/.github/workflows/deb.yml

76 lines
2.3 KiB
YAML
Raw Normal View History

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