mirror of
https://github.com/3proxy/3proxy.git
synced 2026-04-07 13:50:12 +08:00
Create build-rpm-x86-64.yml
This commit is contained in:
parent
b112b92737
commit
35fba82518
49
.github/workflows/build-rpm-x86-64.yml
vendored
Normal file
49
.github/workflows/build-rpm-x86-64.yml
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
name: RPM build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "master" ]
|
||||
paths: [ 'RELEASE', '.github/workflows/build-rpm-x86-64.yml' ]
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
name: "${{ matrix.target }}"
|
||||
strategy:
|
||||
matrix:
|
||||
target:
|
||||
- ubuntu-latest
|
||||
runs-on: ${{ matrix.target }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: env
|
||||
run: |
|
||||
pwd
|
||||
echo "RELEASE==$(cat RELEASE)" >> $GITHUB_ENV
|
||||
echo "VERSION==$(date +%y%m%d%H%M%S)" >> $GITHUB_ENV
|
||||
echo "MAJOR==$(cat RELEASE | cut -d "-" -f 1)" >> $GITHUB_ENV
|
||||
echo "SUBMAJOR==$(cat RELEASE | cut -d "-" -f 2)" >> $GITHUB_ENV
|
||||
echo "MINOR==$(cat RELEASE | cut -d "-" -f 3)" >> $GITHUB_ENV
|
||||
- name: echo env
|
||||
run: echo "release $RELEASE version $VERSION major $MAJOR submajor $SUBMAJOR minor $MINOR"
|
||||
- name: Linux libraries
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install libssl-dev libpam-dev libpcre2-dev rpm
|
||||
- name: make rpmbuild dir
|
||||
run: mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
|
||||
- name: configure rpm env
|
||||
run: |
|
||||
git archive --format=tar --prefix=3proxy-$RELEASE/ master | gzip >~/rpmbuilds/SOURCES/3proxy-$RELEASE.tar.gz
|
||||
cp scripts/rh/3proxy.spec ~/rpmbuild/SPECS/3proxy-$RELEASE.spec
|
||||
- name: rpmbuild
|
||||
run: |
|
||||
ret=`pwd`
|
||||
cd ~/rpmbuild/SPECS
|
||||
rpmbuild --define "devel_version $VERSION" -ba 3proxy-$RELEASE.spec
|
||||
cd $ret
|
||||
mv ~/rpmbuild/RPMS/x86_64/3proxy-$RELEASE-1.x86_64.rpm ../3proxy-$RELEASE.x86_64.rpm
|
||||
- name: Get artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: "3proxy-${{ env.RELEASE }}-rpm"
|
||||
path: "*.rpm"
|
||||
Loading…
Reference in New Issue
Block a user