Add all files
This commit is contained in:
@@ -0,0 +1,85 @@
|
|||||||
|
name: Build APK file
|
||||||
|
run-name: ${{ gitea.actor }} is building APK file
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
verify:
|
||||||
|
name: "Verify environment"
|
||||||
|
runs-on: android
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Debug Environment
|
||||||
|
run: |
|
||||||
|
whoami
|
||||||
|
cat /etc/os-release
|
||||||
|
pwd
|
||||||
|
which java || true
|
||||||
|
env | sort
|
||||||
|
- name: Check Java
|
||||||
|
run: |
|
||||||
|
java -version
|
||||||
|
echo "JAVA_HOME=$JAVA_HOME"
|
||||||
|
|
||||||
|
- name: Check Android SDK
|
||||||
|
run: |
|
||||||
|
echo "ANDROID_HOME=$ANDROID_HOME"
|
||||||
|
echo "PATH=$PATH"
|
||||||
|
|
||||||
|
which sdkmanager || true
|
||||||
|
|
||||||
|
sdkmanager --version || true
|
||||||
|
|
||||||
|
ls -la $ANDROID_HOME || true
|
||||||
|
|
||||||
|
build-android:
|
||||||
|
name: "Build APK file"
|
||||||
|
runs-on: android
|
||||||
|
needs: verify
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Grant execute permission
|
||||||
|
run: chmod +x ./gradlew
|
||||||
|
|
||||||
|
# - name: List Gradle Projects
|
||||||
|
# run: ./gradlew projects
|
||||||
|
|
||||||
|
- name: Build Android APK
|
||||||
|
run: ./gradlew :androidApp:assembleDebug --stacktrace
|
||||||
|
|
||||||
|
- name: Find location APK file
|
||||||
|
run: |
|
||||||
|
find . -name "*.apk"
|
||||||
|
|
||||||
|
- name: Show APK
|
||||||
|
run: |
|
||||||
|
ls -lah androidApp/build/outputs/apk/debug/
|
||||||
|
|
||||||
|
# - uses: actions/upload-artifact@v4
|
||||||
|
# with:
|
||||||
|
# name: TorqueVault-apk
|
||||||
|
# path: androidApp/build/outputs/apk/debug/androidApp-debug.apk
|
||||||
|
|
||||||
|
- name: Build Package Version
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
VERSION_NAME=$(grep -R "versionName" androidApp/build.gradle.kts \
|
||||||
|
| head -1 \
|
||||||
|
| sed 's/.*"\(.*\)".*/\1/')
|
||||||
|
|
||||||
|
SHORT_SHA=$(git rev-parse --short HEAD)
|
||||||
|
|
||||||
|
PACKAGE_VERSION="${VERSION_NAME}+${SHORT_SHA}"
|
||||||
|
|
||||||
|
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
echo "Package Version: $PACKAGE_VERSION"
|
||||||
|
|
||||||
|
- name: Upload APK to Package Registry
|
||||||
|
run: |
|
||||||
|
curl \
|
||||||
|
--fail \
|
||||||
|
--user "${{ github.actor }}:${{ secrets.PACKAGE_TOKEN }}" \
|
||||||
|
--upload-file androidApp/build/outputs/apk/debug/androidApp-debug.apk \
|
||||||
|
"${{ github.server_url }}/api/packages/${{ github.repository_owner }}/generic/torque-vault/${PACKAGE_VERSION}/Torque-Vault.apk"
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
name: Sync Source to Host
|
||||||
|
run-name: ${{ gitea.actor }} is synchronizing the source code to the host
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- develop
|
||||||
|
jobs:
|
||||||
|
sync-source:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Sync repository
|
||||||
|
run: |
|
||||||
|
REPO_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git"
|
||||||
|
REPO_NAME=$(basename "${GITHUB_REPOSITORY}")
|
||||||
|
TARGET_DIR="/data/${REPO_NAME}"
|
||||||
|
BRANCH="${GITHUB_REF_NAME}"
|
||||||
|
|
||||||
|
if [ ! -d "$TARGET_DIR/.git" ]; then
|
||||||
|
echo "Cloning repository..."
|
||||||
|
git clone -b "$BRANCH" "$REPO_URL" "$TARGET_DIR"
|
||||||
|
else
|
||||||
|
echo "Updating repository..."
|
||||||
|
git -C "$TARGET_DIR" fetch origin "$BRANCH"
|
||||||
|
git -C "$TARGET_DIR" checkout "$BRANCH"
|
||||||
|
git -C "$TARGET_DIR" reset --hard "origin/$BRANCH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Current commit:"
|
||||||
|
git -C "$TARGET_DIR" log --oneline -1
|
||||||
Reference in New Issue
Block a user