From 659c79e5dda9368694509cd2a58066ef23b9bfc6 Mon Sep 17 00:00:00 2001 From: Shihaam Abdul Rahman Date: Sat, 28 Mar 2026 22:35:14 +0500 Subject: [PATCH] workflows --- .gitea/workflows/auto-tag.yml | 30 +++++++++++++++++++++++++++ .gitea/workflows/build-apk.yml | 38 ++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 .gitea/workflows/auto-tag.yml create mode 100644 .gitea/workflows/build-apk.yml diff --git a/.gitea/workflows/auto-tag.yml b/.gitea/workflows/auto-tag.yml new file mode 100644 index 0000000..0b28b85 --- /dev/null +++ b/.gitea/workflows/auto-tag.yml @@ -0,0 +1,30 @@ +name: Auto Tag on Version Change + +on: + push: + branches: + - main + +jobs: + check-version: + runs-on: docker-compose + + steps: + - name: Checkout source code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.PAT_GITEA }} + + - name: Create tag if version changed + run: | + VERSION=$(grep 'versionName = ' app/build.gradle.kts | sed 's/.*versionName = "\(.*\)".*/\1/') + echo "Current version: $VERSION" + + if git tag -l | grep -q "^v${VERSION}$"; then + echo "Tag v${VERSION} already exists, skipping" + else + git tag "v${VERSION}" + git push origin "v${VERSION}" + echo "Created and pushed tag v${VERSION}" + fi diff --git a/.gitea/workflows/build-apk.yml b/.gitea/workflows/build-apk.yml new file mode 100644 index 0000000..80faae1 --- /dev/null +++ b/.gitea/workflows/build-apk.yml @@ -0,0 +1,38 @@ +name: Build and Release APK + +on: + push: + tags: + - 'v*' + +jobs: + build: + runs-on: docker-compose + + steps: + - name: Checkout source code + uses: actions/checkout@v4 + + - name: Setup keystore and environment + run: | + echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > app/key.jks + echo "${{ secrets.DOTENV_BASE64 }}" | base64 -d > .build/release/.env + + - name: Build APK + working-directory: .build/release + run: docker compose run --rm release + + - name: Extract changelog + run: bash .build/release/extract-changelog.sh ${{ gitea.ref_name }} + + - name: Create Gitea Release + env: + GITEA_SERVER_URL: ${{ gitea.server_url }} + GITEA_REPOSITORY: ${{ gitea.repository }} + GITEA_TOKEN: ${{ secrets.PAT_GITEA }} + run: | + bash .build/release/create-release.sh \ + "${{ gitea.ref_name }}" \ + "ISODroid ${{ gitea.ref_name }}" \ + "release_notes.md" \ + ".build/release/release/ISODroid-${{ gitea.ref_name }}.apk"