Compare commits
18 Commits
0be1ae97ff
...
9b7f720564
| Author | SHA1 | Date | |
|---|---|---|---|
| 9b7f720564 | |||
| 254c8bb67d | |||
| 122eff7b03 | |||
| 5eeefc0e32 | |||
| cf4aa32061 | |||
| 0e1f2e0bd7 | |||
| 6dffd6786b | |||
| cdf30c7f09 | |||
| 4a118a3883 | |||
| 4f57184e78 | |||
| 1ab2a5069c | |||
| 2ef39942cd | |||
| d08f5169f3 | |||
| 0b83656b9d | |||
| 062232a0bc | |||
| 7b0f443426 | |||
| 08202d097f | |||
| 93a71a75b8 |
@@ -8,34 +8,91 @@ on:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up JDK 21
|
||||
- name: Setup JDK
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '21'
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
|
||||
- name: Setup Android SDK
|
||||
run: |
|
||||
mkdir -p $ANDROID_HOME/cmdline-tools
|
||||
cd $ANDROID_HOME/cmdline-tools
|
||||
wget -q https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip -O cmdline-tools.zip
|
||||
unzip -q cmdline-tools.zip
|
||||
mv cmdline-tools latest
|
||||
echo "y" | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null 2>&1
|
||||
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "platform-tools" "platforms;android-34" "build-tools;34.0.0"
|
||||
uses: android-actions/setup-android@v2
|
||||
|
||||
- name: Build APK
|
||||
- name: Build with Gradle
|
||||
run: |
|
||||
chmod +x ./gradlew
|
||||
./gradlew assembleRelease --no-daemon -Dorg.gradle.java.home=$JAVA_HOME
|
||||
./gradlew assembleRelease --no-daemon
|
||||
|
||||
- name: Upload APK
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: apk
|
||||
path: app/build/outputs/apk/release/*.apk
|
||||
path: app/build/outputs/apk/release/*.apk
|
||||
|
||||
- name: Create Release
|
||||
run: |
|
||||
# Get tag name from git
|
||||
TAG_NAME=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
|
||||
|
||||
if [ -z "$TAG_NAME" ]; then
|
||||
TAG_NAME="${GITHUB_REF#refs/tags/}"
|
||||
fi
|
||||
|
||||
# Quitar la v del tag si existe
|
||||
TAG_NAME_CLEAN="${TAG_NAME#v}"
|
||||
|
||||
APK_FILE=$(ls app/build/outputs/apk/release/*.apk | head -1)
|
||||
|
||||
# Rename APK with version
|
||||
NEW_NAME="Helldivers-app-${TAG_NAME}.apk"
|
||||
cp "$APK_FILE" "$NEW_NAME"
|
||||
|
||||
echo "=== Creating release for tag: $TAG_NAME ==="
|
||||
echo "APK file: $APK_FILE"
|
||||
|
||||
# Use the token from secrets
|
||||
if [ -z "${{ secrets.GITEATOKEN }}" ]; then
|
||||
echo "ERROR: No GITEATOKEN found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create release using Gitea API - Create from existing tag
|
||||
echo "Creating release..."
|
||||
RELEASE_RESP=$(curl -s -X POST "https://git-dangilcal.duckdns.org/api/v1/repos/dangilcal/Helldivers-app-movil/releases" \
|
||||
-H "accept: application/json" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: token ${{ secrets.GITEATOKEN }}" \
|
||||
-d "{
|
||||
\"tag_name\": \"${TAG_NAME}\",
|
||||
\"name\": \"Release ${TAG_NAME_CLEAN}\",
|
||||
\"body\": \"Built from tag ${TAG_NAME}\",
|
||||
\"draft\": false,
|
||||
\"prerelease\": false
|
||||
}")
|
||||
|
||||
echo "Release response: $RELEASE_RESP"
|
||||
|
||||
# Extract release ID
|
||||
RELEASE_ID=$(echo "$RELEASE_RESP" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
|
||||
|
||||
if [ -z "$RELEASE_ID" ]; then
|
||||
echo "ERROR: Could not get release ID"
|
||||
echo "$RELEASE_RESP"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Release ID: $RELEASE_ID"
|
||||
|
||||
# Upload the APK as an asset
|
||||
echo "Uploading APK..."
|
||||
UPLOAD_RESP=$(curl -s -X POST "https://git-dangilcal.duckdns.org/api/v1/repos/dangilcal/Helldivers-app-movil/releases/${RELEASE_ID}/assets" \
|
||||
-H "accept: application/json" \
|
||||
-H "Content-Type: multipart/form-data" \
|
||||
-H "Authorization: token ${{ secrets.GITEATOKEN }}" \
|
||||
-F "attachment=@${NEW_NAME}")
|
||||
|
||||
echo "Upload response: $UPLOAD_RESP"
|
||||
echo "=== Release created successfully ==="
|
||||
|
||||
@@ -9,7 +9,7 @@ android {
|
||||
defaultConfig {
|
||||
applicationId "com.helldivers.app"
|
||||
minSdk 18
|
||||
targetSdk 21
|
||||
targetSdk 34
|
||||
versionCode 1
|
||||
versionName "1.0.0-LIBERTY"
|
||||
multiDexEnabled true
|
||||
@@ -27,14 +27,14 @@ android {
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_21
|
||||
targetCompatibility JavaVersion.VERSION_21
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
coreLibraryDesugaringEnabled true
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion = JavaLanguageVersion.of(21)
|
||||
languageVersion = JavaLanguageVersion.of(17)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.6 KiB |
47
docker-compose.yml
Normal file
47
docker-compose.yml
Normal file
@@ -0,0 +1,47 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
gitea:
|
||||
image: gitea/gitea:latest
|
||||
container_name: gitea
|
||||
restart: always
|
||||
environment:
|
||||
- USER_UID=1000
|
||||
- USER_GID=1000
|
||||
volumes:
|
||||
- /srv/data/gitea:/data
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
networks:
|
||||
- proxy
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.gitea.rule=Host(`git-dangilcal.duckdns.org`)"
|
||||
- "traefik.http.routers.gitea.entrypoints=websecure"
|
||||
- "traefik.http.routers.gitea.tls.certresolver=le"
|
||||
- "traefik.http.services.gitea.loadbalancer.server.port=3000"
|
||||
- "traefik.http.routers.gitea-http.rule=Host(`git-dangilcal.duckdns.org`)"
|
||||
- "traefik.http.routers.gitea-http.entrypoints=web"
|
||||
- "traefik.http.routers.gitea-http.middlewares=redirect-to-https"
|
||||
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
|
||||
- "traefik.http.middlewares.redirect-to-https.redirectscheme.permanent=true"
|
||||
|
||||
gitea-runner:
|
||||
image: gitea/act_runner:latest
|
||||
container_name: gitea-runner
|
||||
restart: always
|
||||
depends_on:
|
||||
- gitea
|
||||
environment:
|
||||
- GITEA_INSTANCE_URL=https://git-dangilcal.duckdns.org
|
||||
- GITEA_RUNNER_REGISTRATION_TOKEN=TU_TOKEN_AQUI
|
||||
- GITEA_RUNNER_NAME=runner-docker
|
||||
volumes:
|
||||
- /srv/data/gitea-runner:/data
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
networks:
|
||||
- proxy
|
||||
|
||||
networks:
|
||||
proxy:
|
||||
external: true
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
Reference in New Issue
Block a user