ci: remove external action dependencies in Forgejo workflow
Some checks failed
Forgejo Release Builder / release (push) Failing after 0s

Replace setup-java, write-file-action, and setup-gradle action steps with shell-based equivalents for reliable Forgejo execution.
This commit is contained in:
littlecodedragon 2026-04-27 04:51:29 +02:00
parent dbee19612b
commit 138a92854e

View file

@ -23,24 +23,33 @@ jobs:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v4 # Forgejo-compatible (node20)
with:
java-version: 17
distribution: temurin
shell: bash
run: |
set -euo pipefail
if command -v java >/dev/null 2>&1; then
java -version
else
apt-get update
apt-get install -y openjdk-17-jdk
java -version
fi
- name: Write google-services.json
uses: DamianReeves/write-file-action@6929a9a6d1807689191dcc8bbe62b54d70a32b42 # v1.3
with:
path: app/google-services.json
contents: ${{ secrets.GOOGLE_SERVICES_JSON }}
write-mode: overwrite
shell: bash
run: |
set -euo pipefail
cat > app/google-services.json <<'EOF'
${{ secrets.GOOGLE_SERVICES_JSON }}
EOF
- name: Write client_secrets.json
uses: DamianReeves/write-file-action@6929a9a6d1807689191dcc8bbe62b54d70a32b42 # v1.3
with:
path: app/src/main/assets/client_secrets.json
contents: ${{ secrets.GOOGLE_CLIENT_SECRETS_JSON }}
write-mode: overwrite
shell: bash
run: |
set -euo pipefail
mkdir -p app/src/main/assets
cat > app/src/main/assets/client_secrets.json <<'EOF'
${{ secrets.GOOGLE_CLIENT_SECRETS_JSON }}
EOF
- name: Prepare release metadata
id: prepare
@ -67,7 +76,11 @@ jobs:
} >> "$GITHUB_OUTPUT"
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4.4.2 # Forgejo-compatible (node20)
shell: bash
run: |
set -euo pipefail
chmod +x ./gradlew
./gradlew --version
- name: Check code format
run: ./gradlew spotlessCheck