Update build.yml #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create RPM Package for Deepin Music | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install build tools | |
run: | | |
sudo apt update | |
sudo apt install -y rpm build-essential cmake | |
- name: Build deepin-music | |
run: | | |
mkdir -p Build | |
cd Build | |
cmake .. | |
make | |
- name: Prepare RPM build structure | |
run: | | |
mkdir -p rpm/{BUILD,RPMS,SOURCES,SPECS,SRPMS} | |
tar -czvf rpm/SOURCES/deepin-music.tar.gz -C .. . | |
- name: Create deepin-music.spec file | |
run: | | |
cat <<EOF > rpm/SPECS/deepin-music.spec | |
Name: deepin-music | |
Version: 1.0 | |
Release: 1%{?dist} | |
Summary: Deepin Music Player RPM Package | |
License: GPL | |
Source: deepin-music.tar.gz | |
BuildRequires: cmake, gcc, make, qt5-qmake, qt5-devel, libtag-devel, ffmpeg-devel, vlc-devel | |
Requires: qt5, libtag, ffmpeg, vlc | |
%description | |
Deepin Music Player is an awesome music player built by the Deepin project. | |
%prep | |
%setup -q | |
%build | |
mkdir -p Build | |
cd Build | |
cmake .. | |
make | |
%install | |
mkdir -p %{buildroot}/usr/bin | |
install -m 0755 Build/deepin-music %{buildroot}/usr/bin/ | |
%files | |
/usr/bin/deepin-music | |
%changelog | |
* Thu Oct 14 2024 Your Name <[email protected]> 1.0-1 | |
- Initial RPM release for Deepin Music | |
EOF | |
- name: Build RPM package | |
run: | | |
rpmbuild -ba rpm/SPECS/deepin-music.spec --define "_topdir $(pwd)/rpm" | |
- name: Upload RPM package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: deepin-music-rpm | |
path: rpm/RPMS/ |