diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index f523d20..86f6c69 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -5,13 +5,12 @@ jobs: fedora-compilation: runs-on: fedora-latest steps: - - name: Paketleri ve Git'i Kur + - name: Gerekli Araçları Kur run: | - dnf install -y git gcc gcc-c++ make cmake pkgconfig + dnf install -y git gcc gcc-c++ make cmake pkgconfig curl - name: Kodları Manuel Çek run: | - # Gitea içindeki servis adını kullanarak kodu çekiyoruz git clone https://git.y1lm0z.me/y1lm0z/cmus.git . - name: Bağımlılıkları Kur @@ -29,21 +28,18 @@ jobs: - 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: Derlenen Dosyaları Pakete Koy - uses: actions/upload-artifact@v3 - with: - name: cmus-fedora-derlemesi # İndireceğin zip dosyasının adı - path: | - cmus - cmus-remote - # Eğer başka dosyalar da varsa buraya ekleyebilirsin + 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: Manuel Release Yükle (API ile) + run: | + # Derlenen dosyayı zipleyelim + tar -czvf cmus-fedora.tar.gz cmus cmus-remote + + # Gitea API kullanarak dosyayı "Attachment" olarak yükle + # Gitea iç network üzerinden token ile gönderiyoruz + # Not: 'secrets.RELEASE_TOKEN' kısmını aşağıda açıklayacağım + curl -H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \ + -F "attachment=@cmus-fedora.tar.gz" \ + "https://git.y1lm0z.me/api/v1/repos/${{ gitea.repository }}/releases/latest/assets" || echo "Release bulunamadı, manuel oluşturun."