diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index ea741f2..fab895f 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -47,7 +47,7 @@ jobs: git commit -m "chore: bump version to ${{ steps.bump.outputs.VERSION }} [skip ci]" git push - build-android: + build-and-release: runs-on: ubuntu-latest needs: increment-version if: always() && (needs.increment-version.outputs.should_build == 'true' || needs.increment-version.result == 'skipped') @@ -56,6 +56,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 with: + fetch-depth: 0 submodules: false ref: ${{ github.ref_name }} @@ -92,28 +93,6 @@ jobs: - name: Apply overlay and build Android APK run: npm run android:apk:linux - - name: Upload APK - uses: actions/upload-artifact@v4 - with: - name: Paarrot-Android - path: android/app/build/outputs/apk/debug/Paarrot-*.apk - - create-release: - runs-on: ubuntu-latest - needs: [increment-version, build-android] - if: always() && needs.build-android.result == 'success' - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - ref: ${{ github.ref_name }} - - - name: Pull latest (after version bump) - if: github.ref == 'refs/heads/master' - run: git pull origin master - - name: Get version id: version run: | @@ -143,22 +122,6 @@ jobs: git tag -a "v${{ steps.version.outputs.VERSION }}" -m "Release v${{ steps.version.outputs.VERSION }}" git push origin "v${{ steps.version.outputs.VERSION }}" - - name: Download all artifacts - uses: actions/download-artifact@v4 - with: - path: artifacts - - - name: Prepare release files - run: | - mkdir -p release-files - find artifacts -type f \( -name "*.exe" -o -name "*.AppImage" -o -name "*.nupkg" -o -name "RELEASES*" \) -exec cp {} release-files/ \; - APK=$(find artifacts -type f -name "*.apk" | head -1) - if [ -n "$APK" ]; then - VERSION="${{ steps.version.outputs.VERSION }}" - cp "$APK" "release-files/Paarrot-${VERSION}.apk" - fi - ls -la release-files/ - - name: Create or Update Release env: GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -168,6 +131,13 @@ jobs: API_BASE="http://synbox.ruv.wtf:8418/api/v1" REPO="litruv/cinny-mobile" + APK=$(find android/app/build/outputs/apk/debug -name "Paarrot-*.apk" | head -1) + if [ -z "$APK" ]; then + echo "No APK found!" + exit 1 + fi + echo "Found APK: $APK" + RELEASE_ID=$(curl -s -H "Authorization: token ${GITEA_TOKEN}" \ "${API_BASE}/repos/${REPO}/releases/tags/${TAG_NAME}" | jq -r '.id // empty') @@ -189,16 +159,13 @@ jobs: done fi - echo "Uploading assets..." - for FILE in release-files/*; do - FILENAME=$(basename "$FILE") - echo "Uploading ${FILENAME}..." - curl -s -X POST \ - -H "Authorization: token ${GITEA_TOKEN}" \ - -H "Content-Type: application/octet-stream" \ - --data-binary "@${FILE}" \ - "${API_BASE}/repos/${REPO}/releases/${RELEASE_ID}/assets?name=${FILENAME}" - echo "" - done + FILENAME="Paarrot-${VERSION}.apk" + echo "Uploading ${FILENAME}..." + curl -s -X POST \ + -H "Authorization: token ${GITEA_TOKEN}" \ + -H "Content-Type: application/octet-stream" \ + --data-binary "@${APK}" \ + "${API_BASE}/repos/${REPO}/releases/${RELEASE_ID}/assets?name=${FILENAME}" + echo "" echo "Release complete!"