build dosyası düzenleme 8
Some checks failed
MusicPlayer Fedora RPM Build / fedora-compilation (push) Failing after 3m6s
Some checks failed
MusicPlayer Fedora RPM Build / fedora-compilation (push) Failing after 3m6s
This commit is contained in:
@@ -9,11 +9,11 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Gerekli Araçları Kur
|
- name: Gerekli Araçları Kur
|
||||||
run: |
|
run: |
|
||||||
dnf install -y git gcc gcc-c++ make cmake pkgconfig curl rpm-build rpmdevtools
|
# 'jq' paketini ekledik (Gitea API'den gelen verileri güvenle okumak için)
|
||||||
|
dnf install -y git gcc gcc-c++ make cmake pkgconfig curl rpm-build rpmdevtools jq
|
||||||
|
|
||||||
- name: Kodları Manuel Çek
|
- name: Kodları Manuel Çek
|
||||||
run: |
|
run: |
|
||||||
# Kendi domain adresini kullanarak kodu çekiyoruz
|
|
||||||
git clone https://git.y1lm0z.me/y1lm0z/cmus.git .
|
git clone https://git.y1lm0z.me/y1lm0z/cmus.git .
|
||||||
|
|
||||||
- name: Bağımlılıkları Kur
|
- name: Bağımlılıkları Kur
|
||||||
@@ -44,52 +44,55 @@ jobs:
|
|||||||
|
|
||||||
- name: RPM Paketi Oluştur
|
- name: RPM Paketi Oluştur
|
||||||
run: |
|
run: |
|
||||||
# RPM klasör yapısını kur
|
|
||||||
rpmdev-setuptree
|
rpmdev-setuptree
|
||||||
|
mkdir -p ~/rpmbuild/BUILD/usr/bin
|
||||||
|
cp cmus cmus-remote ~/rpmbuild/BUILD/usr/bin/
|
||||||
|
|
||||||
# Dosyaları sanal bir sistem köküne yerleştir
|
|
||||||
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/
|
|
||||||
|
|
||||||
# RPM'in pasaportu olan SPEC dosyasını oluştur
|
|
||||||
cat <<EOF > cmus.spec
|
cat <<EOF > cmus.spec
|
||||||
Name: cmus-custom
|
Name: cmus-custom
|
||||||
Version: 1.0
|
Version: 1.0
|
||||||
Release: 1
|
Release: 1
|
||||||
Summary: Custom Fedora Build for Cmus
|
Summary: Custom Fedora Build for Cmus
|
||||||
License: GPL
|
License: GPL
|
||||||
Group: Applications/Multimedia
|
%define _build_id_links none
|
||||||
|
%global debug_package %{nil}
|
||||||
|
|
||||||
%description
|
%description
|
||||||
y1lm0z tarafından Gitea Actions ile otomatik derlenen cmus paketi.
|
y1lm0z tarafından Gitea Actions ile otomatik derlenen cmus paketi.
|
||||||
|
|
||||||
|
%install
|
||||||
|
mkdir -p %{buildroot}/usr/bin
|
||||||
|
cp %{_builddir}/usr/bin/cmus %{buildroot}/usr/bin/
|
||||||
|
cp %{_builddir}/usr/bin/cmus-remote %{buildroot}/usr/bin/
|
||||||
|
|
||||||
%files
|
%files
|
||||||
/usr/bin/cmus
|
/usr/bin/cmus
|
||||||
/usr/bin/cmus-remote
|
/usr/bin/cmus-remote
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Paketi inşa et
|
|
||||||
rpmbuild -bb cmus.spec
|
rpmbuild -bb cmus.spec
|
||||||
|
|
||||||
# Oluşan dosyayı ana dizine 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: |
|
||||||
RPM_NAME=$(ls *.rpm)
|
# 1. Dosyaya benzersiz bir isim verelim (Aynı isimde dosya yükleme hatasını önlemek için)
|
||||||
echo "Yüklenecek dosya: $RPM_NAME"
|
SHORT_SHA=$(git rev-parse --short HEAD)
|
||||||
|
NEW_RPM_NAME="cmus-custom-${SHORT_SHA}.x86_64.rpm"
|
||||||
|
mv *.rpm $NEW_RPM_NAME
|
||||||
|
echo "Yüklenecek dosya: $NEW_RPM_NAME"
|
||||||
|
|
||||||
# 1. Eğer 'v1.0' adında bir sürüm yoksa oluştur (Hata verirse devam et)
|
# 2. 'v1.0' adında bir Release yoksa oluştur
|
||||||
curl -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
|
||||||
|
|
||||||
# 2. Gitea API'den o sürümün ID numarasını al
|
# 3. 'v1.0' etiketli sürümün tam ID'sini 'jq' kullanarak %100 güvenli şekilde 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" | \
|
"https://git.y1lm0z.me/api/v1/repos/${{ gitea.repository }}/releases/tags/v1.0" | jq '.id')
|
||||||
grep -Po '"id":\s*\K\d+' | head -n 1)
|
|
||||||
|
|
||||||
# 3. RPM dosyasını o ID'ye sahip Release içine yükle
|
# 4. Benzersiz isme sahip RPM dosyasını o ID'ye yükle
|
||||||
curl -X 'POST' \
|
curl -X 'POST' \
|
||||||
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
||||||
-F "attachment=@$RPM_NAME" \
|
-F "attachment=@$NEW_RPM_NAME" \
|
||||||
"https://git.y1lm0z.me/api/v1/repos/${{ gitea.repository }}/releases/$RELEASE_ID/assets"
|
"https://git.y1lm0z.me/api/v1/repos/${{ gitea.repository }}/releases/$RELEASE_ID/assets"
|
||||||
|
|||||||
Reference in New Issue
Block a user