.gitea/workflows/build-release.yaml aktualisiert
Android Build & Release / build (push) Failing after 1s
Android Build & Release / build (push) Failing after 1s
This commit is contained in:
1 parent
c1ed1dc21a
commit
45ee35c9a7
1 file changed
+9
-22
@@ -9,34 +9,21 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Code (Absolut sicherer Direkt-Fetch)
|
- name: Checkout Code (Direkt-Download)
|
||||||
run: |
|
run: |
|
||||||
git init
|
# 1. Zip über die Gitea-API via interner Docker-IP ziehen
|
||||||
# Wir nutzen die Host-IP des Servers (172.17.0.1 ist die Standard-Docker-Bridge-IP zum Server selbst)
|
|
||||||
# und gehen über den SSH-Port 222, den du in deiner Compose-Datei freigegeben hast!
|
|
||||||
git remote add origin ssh://git@172.17.0.1:222/${{ github.repository }}.git
|
|
||||||
|
|
||||||
# SSH-Prüfung für den Moment deaktivieren, damit er nicht nach "Are you sure you want to continue connecting" fragt:
|
|
||||||
export GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no"
|
|
||||||
|
|
||||||
# Da wir kein SSH-Key hinterlegt haben, nutzen wir stattdessen das Token als Passwort via HTTP-Fallback,
|
|
||||||
# ODER wir sagen Gitea, er soll es lokal aus dem Pfad holen, falls der Runner Zugriff hat.
|
|
||||||
# Versuchen wir den direkten Curl-Download des Repositories als ZIP – das braucht kein Git-Netzwerk!
|
|
||||||
|
|
||||||
curl -L -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
curl -L -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||||
"http://172.17.0.1:3000/api/v1/repos/${{ github.repository }}/archive/main.zip" -o repo.zip
|
"http://172.17.0.1:3000/api/v1/repos/${{ github.repository }}/archive/main.zip" -o repo.zip
|
||||||
|
|
||||||
|
# 2. Entpacken und aufräumen
|
||||||
unzip repo.zip
|
unzip repo.zip
|
||||||
# Inhalt in den aktuellen Ordner verschieben (Gitea packt es meist in einen Unterordner)
|
|
||||||
mv Screenity/* . 2>/dev/null || mv */* . 2>/dev/null
|
mv Screenity/* . 2>/dev/null || mv */* . 2>/dev/null
|
||||||
rm repo.zip
|
rm repo.zip
|
||||||
|
|
||||||
- name: Java einrichten
|
- name: Java Version prüfen
|
||||||
uses: actions/setup-java@v4
|
run: |
|
||||||
with:
|
# Nutzt das bereits im Docker-Image vorinstallierte Java 17/21
|
||||||
java-version: '17'
|
java -version
|
||||||
distribution: 'temurin'
|
|
||||||
cache: gradle
|
|
||||||
|
|
||||||
- name: Keystore Datei aus Secret erstellen
|
- name: Keystore Datei aus Secret erstellen
|
||||||
run: echo "${{ secrets.SIGNING_KEY }}" | base64 -d > app/keystore.jks
|
run: echo "${{ secrets.SIGNING_KEY }}" | base64 -d > app/keystore.jks
|
||||||
@@ -55,7 +42,7 @@ jobs:
|
|||||||
- name: Gitea Release via API erstellen und APK hochladen
|
- name: Gitea Release via API erstellen und APK hochladen
|
||||||
run: |
|
run: |
|
||||||
# 1. Release in Gitea erstellen und die ID abfangen
|
# 1. Release in Gitea erstellen und die ID abfangen
|
||||||
RELEASE_ID=$(curl -X POST "${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases" \
|
RELEASE_ID=$(curl -X POST "http://172.17.0.1:3000/api/v1/repos/${{ github.repository }}/releases" \
|
||||||
-H "accept: application/json" \
|
-H "accept: application/json" \
|
||||||
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
@@ -68,7 +55,7 @@ jobs:
|
|||||||
for apk in app/build/outputs/apk/release/*.apk; do
|
for apk in app/build/outputs/apk/release/*.apk; do
|
||||||
if [ -f "$apk" ]; then
|
if [ -f "$apk" ]; then
|
||||||
echo "Lade hoch: $apk"
|
echo "Lade hoch: $apk"
|
||||||
curl -X POST "${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases/$RELEASE_ID/assets" \
|
curl -X POST "http://172.17.0.1:3000/api/v1/repos/${{ github.repository }}/releases/$RELEASE_ID/assets" \
|
||||||
-H "accept: application/json" \
|
-H "accept: application/json" \
|
||||||
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||||
-H "Content-Type: multipart/form-data" \
|
-H "Content-Type: multipart/form-data" \
|
||||||
|
|||||||
Reference in new issue
Block a user