2020-11-07 22:10:13 -05:00
|
|
|
name: Build debian packages
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2020-11-23 07:51:58 -05:00
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- v*
|
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
|
|
|
|
container: debian:sid
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Install git
|
|
|
|
run: |
|
|
|
|
apt-get update
|
|
|
|
apt-get install -y git
|
2020-11-08 23:28:26 -05:00
|
|
|
|
|
|
|
- name: Checkout codebase
|
2020-11-07 22:10:13 -05:00
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
2021-01-04 09:15:22 -05:00
|
|
|
submodules: "recursive"
|
2020-11-08 23:28:26 -05:00
|
|
|
|
2020-11-07 22:10:13 -05:00
|
|
|
- name: Install build dependencies
|
|
|
|
run: |
|
2020-11-09 09:52:37 -05:00
|
|
|
apt-get install -y build-essential dh-golang golang-any reprepro
|
2020-11-08 23:28:26 -05:00
|
|
|
|
2020-11-07 22:10:13 -05:00
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
cp -r release/debian .
|
|
|
|
dpkg-buildpackage -us -uc -i -b
|
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
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
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-01-04 19:58:46 -05:00
|
|
|
if: github.event_name == 'release'
|
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
|