1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-03 01:38:24 -04:00
v2fly/.github/workflows/deb.yml
dependabot[bot] d877bad50e
Chore: bump actions/upload-artifact from 2 to 3 (#1724)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-09 17:42:04 +08:00

76 lines
2.3 KiB
YAML

name: Build debian packages
on:
workflow_dispatch:
push:
branches:
- master
- v*
paths:
- ".github/workflows/deb.yml"
- "release/debian/*"
pull_request:
types: [opened, synchronize, reopened]
paths:
- ".github/workflows/deb.yml"
- "release/debian/*"
release:
types: [prereleased]
jobs:
package:
if: github.repository == 'v2fly/v2ray-core'
runs-on: ubuntu-latest
container: golang:1.17-bullseye
steps:
- name: Update & install dependencies
run: |
apt-get update
apt-get install -y git wget
- name: Checkout codebase
uses: actions/checkout@v3
- 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: |
apt-get install -y build-essential dh-golang reprepro
- name: Build
run: |
echo "PATH=${PATH}"
cp -r release/debian .
dpkg-buildpackage -us -uc -i -b -d
- name: Copy binary
run: |
cp ../*.deb ./
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: v2ray-debian-packages
path: ./*.deb
- name: Setup Repository
if: ${{ github.event_name == 'release' || github.event_name == 'workflow_dispatch' }}
run: |
git clone https://github.com/v2fly/debian.git archive
echo ${{ secrets.DEBIAN_GPG_PRIVATE }} | base64 -d > private.key
gpg --import --batch private.key
gpg -K
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
reprepro includedeb stable ../*.deb
git add -A
git commit -am 'update'
git push origin main