build dosyası düzenleme 9
All checks were successful
MusicPlayer Fedora RPM Build / fedora-compilation (push) Successful in 2m45s

This commit is contained in:
2026-03-29 15:12:33 +03:00
parent 999b02b4c4
commit 7834818b04

View File

@@ -43,12 +43,15 @@ jobs:
- name: RPM Paketi Oluştur - name: RPM Paketi Oluştur
run: | run: |
# 1. RPM ağacını oluştur
rpmdev-setuptree rpmdev-setuptree
# Çalışma dizinimizin tam yolunu alıyoruz (Örn: /workspace/y1lm0z/cmus) # 2. Dosyaları RPM'in varsayılan BUILDROOT klasörüne MANUEL yerleştiriyoruz
WORKSPACE=$(pwd) # Bu sayede SPEC içindeki %install adımına gerek kalmayacak
mkdir -p ~/rpmbuild/BUILDROOT/cmus-custom-1.0-1.x86_64/usr/bin
cp cmus cmus-remote ~/rpmbuild/BUILDROOT/cmus-custom-1.0-1.x86_64/usr/bin/
# SPEC dosyasını oluştur # 3. SPEC dosyasını en basit haliyle oluştur (Sadece paketleme yapar)
cat <<EOF > cmus.spec cat <<EOF > cmus.spec
Name: cmus-custom Name: cmus-custom
Version: 1.0 Version: 1.0
@@ -59,49 +62,41 @@ jobs:
%global debug_package %{nil} %global debug_package %{nil}
%description %description
y1lm0z tarafından Gitea Actions ile otomatik derlenen cmus paketi. y1lm0z tarafından otomatik derlenen cmus paketi.
%install
mkdir -p %{buildroot}/usr/bin
# RPM'in kafasına göre klasör aramasını engellemek için dosyaları
# direkt olarak derlediğimiz klasörden (WORKSPACE) aldırıyoruz.
cp \${WORKSPACE}/cmus %{buildroot}/usr/bin/
cp \${WORKSPACE}/cmus-remote %{buildroot}/usr/bin/
%files %files
/usr/bin/cmus /usr/bin/cmus
/usr/bin/cmus-remote /usr/bin/cmus-remote
EOF EOF
rpmbuild -bb cmus.spec # 4. Sadece dosyaları paketle (Derleme veya kurulum adımlarını atla)
rpmbuild -bb --define "_topdir $HOME/rpmbuild" --buildroot $HOME/rpmbuild/BUILDROOT/cmus-custom-1.0-1.x86_64 cmus.spec
# 5. RPM'i çalışma dizinine al
cp ~/rpmbuild/RPMS/x86_64/*.rpm . cp ~/rpmbuild/RPMS/x86_64/*.rpm .
- name: Release Kontrol Et ve RPM'i Yükle - name: Release Kontrol Et ve RPM'i Yükle
run: | run: |
# 1. Dosyaya Commit ID'sini ekleyerek benzersiz bir isim ver (Çakışmayı önler)
SHORT_SHA=$(git rev-parse --short HEAD) SHORT_SHA=$(git rev-parse --short HEAD)
NEW_RPM_NAME="cmus-custom-${SHORT_SHA}.x86_64.rpm" NEW_RPM_NAME="cmus-custom-${SHORT_SHA}.x86_64.rpm"
mv *.rpm $NEW_RPM_NAME mv *.rpm $NEW_RPM_NAME
echo "Yüklenecek dosya: $NEW_RPM_NAME"
# Release oluştur (yoksa)
# 2. 'v1.0' adında bir Release yoksa oluştur
curl -s -X 'POST' "https://git.y1lm0z.me/api/v1/repos/${{ gitea.repository }}/releases" \ curl -s -X 'POST' "https://git.y1lm0z.me/api/v1/repos/${{ gitea.repository }}/releases" \
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \ -H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d '{"tag_name": "v1.0", "name": "Fedora Build v1.0", "body": "Otomatik RPM derlemesi", "draft": false, "prerelease": false}' || true -d '{"tag_name": "v1.0", "name": "Fedora Build v1.0", "body": "Otomatik RPM derlemesi", "draft": false, "prerelease": false}' || true
# 3. 'v1.0' etiketli sürümün tam ID'sini 'jq' kullanarak güvenli şekilde al # ID al
RELEASE_ID=$(curl -s -H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \ 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') "https://git.y1lm0z.me/api/v1/repos/${{ gitea.repository }}/releases/tags/v1.0" | jq -r '.id')
# ID bulunamazsa güvenli çıkış yap (Sonsuz hatayı önler)
if [ -z "$RELEASE_ID" ] || [ "$RELEASE_ID" == "null" ]; then if [ -z "$RELEASE_ID" ] || [ "$RELEASE_ID" == "null" ]; then
echo "HATA: Release ID bulunamadı! Token veya izinleri kontrol edin." echo "Release ID bulunamadı!"
exit 1 exit 1
fi fi
# 4. Benzersiz isme sahip RPM dosyasını o ID'ye yükle # Yükle
curl -X 'POST' \ curl -X 'POST' \
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \ -H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
-F "attachment=@$NEW_RPM_NAME" \ -F "attachment=@$NEW_RPM_NAME" \