name: MusicPlayer Fedora RPM Build run-name: ${{ gitea.actor }} tarafından Tam Paket Fedora RPM derleniyor 🚀 on: [push] jobs: fedora-compilation: runs-on: fedora-latest steps: - name: Gerekli Araçları Kur run: | dnf install -y git gcc gcc-c++ make cmake pkgconfig curl rpm-build rpmdevtools jq - name: Kodları Manuel Çek run: | git clone https://git.y1lm0z.me/y1lm0z/cmus.git . - name: Bağımlılıkları Kur run: | dnf install -y https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm || true dnf install -y \ 'pkgconfig(ncursesw)' 'pkgconfig(alsa)' 'pkgconfig(ao)' \ 'pkgconfig(libcddb)' 'pkgconfig(libcdio_cdda)' 'pkgconfig(libdiscid)' \ 'pkgconfig(libavformat)' 'pkgconfig(libavcodec)' 'pkgconfig(libswresample)' \ 'pkgconfig(flac)' 'pkgconfig(jack)' 'pkgconfig(mad)' \ 'pkgconfig(libmodplug)' libmpcdec-devel 'pkgconfig(libsystemd)' \ 'pkgconfig(opusfile)' 'pkgconfig(libpulse)' 'pkgconfig(samplerate)' \ 'pkgconfig(vorbisfile)' 'pkgconfig(wavpack)' \ faad2-devel libmp4v2-devel - name: Derle run: | if [ -f ./configure ]; then ./configure prefix=/usr make -j$(nproc) elif [ -f CMakeLists.txt ]; then mkdir -p build && cd build cmake .. make -j$(nproc) else make -j$(nproc) fi - name: RPM Paketi Oluştur (Full Plugin Support) run: | rpmdev-setuptree # 1. Tüm dosyaları (binary, plugins, man pages, rc) geçici bir dizine kuruyoruz # Bu adım /usr/lib/cmus ve /usr/share/cmus klasörlerini otomatik oluşturur. mkdir -p ~/rpmbuild/BUILDROOT/cmus-custom-1.0-1.x86_64 make install DESTDIR=~/rpmbuild/BUILDROOT/cmus-custom-1.0-1.x86_64 # 2. SPEC dosyasını tüm klasörleri kapsayacak şekilde oluştur cat < cmus.spec Name: cmus-custom Version: 1.0 Release: 1 Summary: Full Fedora Build for Cmus (with Plugins) License: GPL %define _build_id_links none %global debug_package %{nil} %description y1lm0z tarafından tüm giriş/çıkış eklentileri (ip/op) dahil edilerek derlenen cmus paketi. %files # Program dosyaları /usr/bin/cmus /usr/bin/cmus-remote # Eklentiler (Hata aldığın yer burasıydı) /usr/lib/cmus/ # Ayar ve tema dosyaları /usr/share/cmus/ # Yardım sayfaları (Opsiyonel ama iyi olur) /usr/share/man/man1/cmus* /usr/share/man/man7/cmus* EOF # 3. Paketi inşa et (Hazırladığımız BUILDROOT'u kullanıyoruz) rpmbuild -bb --buildroot $HOME/rpmbuild/BUILDROOT/cmus-custom-1.0-1.x86_64 cmus.spec # 4. RPM'i çalışma dizinine al cp ~/rpmbuild/RPMS/x86_64/*.rpm . - name: Release Kontrol Et ve RPM'i Yükle run: | SHORT_SHA=$(git rev-parse --short HEAD) NEW_RPM_NAME="cmus-full-${SHORT_SHA}.x86_64.rpm" mv *.rpm $NEW_RPM_NAME # Release oluştur curl -s -X 'POST' "https://git.y1lm0z.me/api/v1/repos/${{ gitea.repository }}/releases" \ -H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \ -H "Content-Type: application/json" \ -d '{"tag_name": "v1.0", "name": "Fedora Build v1.0", "body": "Full Plugin Support RPM", "draft": false, "prerelease": false}' || true # ID al (jq ile güvenli) RELEASE_ID=$(curl -s -H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \ "https://git.y1lm0z.me/api/v1/repos/${{ gitea.repository }}/releases/tags/v1.0" | jq -r '.id') if [ -z "$RELEASE_ID" ] || [ "$RELEASE_ID" == "null" ]; then echo "Hata: Release ID bulunamadı!" exit 1 fi # Yükle curl -X 'POST' \ -H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \ -F "attachment=@$NEW_RPM_NAME" \ "https://git.y1lm0z.me/api/v1/repos/${{ gitea.repository }}/releases/$RELEASE_ID/assets"