2024-03-22 02:37:29 +01:00
|
|
|
name: Linux
|
2024-03-15 01:45:55 +01:00
|
|
|
on: push
|
|
|
|
jobs:
|
|
|
|
Release:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-03-22 02:37:29 +01:00
|
|
|
include:
|
|
|
|
- name: Enterprise Linux 7
|
|
|
|
version: el7
|
|
|
|
- name: Enterprise Linux 8
|
|
|
|
version: el8
|
|
|
|
- name: Enterprise Linux 9
|
|
|
|
version: el9
|
|
|
|
- name: openSUSE Leap 15.5
|
|
|
|
version: lp155
|
2024-03-15 01:45:55 +01:00
|
|
|
steps:
|
|
|
|
- name: Cloning
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Preparing
|
|
|
|
run: mkdir -m 777 ${{github.workspace}}/rpms
|
|
|
|
- name: Build RPM
|
|
|
|
uses: addnab/docker-run-action@v3
|
|
|
|
with:
|
|
|
|
image: docker.io/syping/dtranslatebot-build:${{matrix.version}}
|
|
|
|
options: -v ${{github.workspace}}:/home/rpmbuild/dtranslatebot -v ${{github.workspace}}/rpms:/home/rpmbuild/rpmbuild/RPMS
|
|
|
|
run: |
|
|
|
|
VERSION=$(cat dtranslatebot/CMakeLists.txt | grep -oP "project\(dtranslatebot VERSION \K(\S*)(?= LANGUAGES CXX\))")
|
|
|
|
mkdir -p dtranslatebot-$VERSION
|
|
|
|
shopt -s extglob
|
|
|
|
cp -R dtranslatebot/!(rpms|rpmsrc) \
|
|
|
|
dtranslatebot-$VERSION
|
|
|
|
tar cfz dtranslatebot-$VERSION.tar.gz dtranslatebot-$VERSION
|
|
|
|
cp dtranslatebot-$VERSION.tar.gz \
|
|
|
|
dtranslatebot/rpmsrc/!(*.spec) \
|
|
|
|
rpmbuild/SOURCES
|
|
|
|
cp dtranslatebot/rpmsrc/*.spec \
|
|
|
|
rpmbuild/SPECS
|
|
|
|
rpmbuild -ba rpmbuild/SPECS/dtranslatebot.spec
|
|
|
|
- name: Upload
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
2024-03-22 02:37:29 +01:00
|
|
|
name: ${{matrix.name}}
|
2024-03-15 01:45:55 +01:00
|
|
|
path: |
|
|
|
|
${{github.workspace}}/rpms/x86_64/*.rpm
|