From ae6e4ff28da9dbb21c4e2df5f2c65712726ddf81 Mon Sep 17 00:00:00 2001 From: ankek Date: Thu, 1 Oct 2026 08:29:11 +0300 Subject: [PATCH 1/2] apk --- .github/workflows/release.yml | 72 +++++++++++++++++++++++++++-------- 1 file changed, 56 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a2a82b6..bb1a30a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,15 +2,65 @@ name: Release on: push: + branches: [main] tags: - "v*.*.*" + workflow_dispatch: + +concurrency: + group: release + cancel-in-progress: false permissions: contents: write jobs: + check: + name: Check version + runs-on: ubuntu-latest + outputs: + version: ${{ steps.version.outputs.version }} + tag: ${{ steps.version.outputs.tag }} + publish: ${{ steps.version.outputs.publish }} + + steps: + - uses: actions/checkout@v5 + + - name: Read app version + id: version + env: + GH_TOKEN: ${{ github.token }} + run: | + version=$(sed -n 's/.*ClientVersion\.validate("\([^"]*\)").*/\1/p' android-app/app/build.gradle.kts) + if [ -z "$version" ]; then + echo "::error::Could not read the app version from android-app/app/build.gradle.kts" + exit 1 + fi + tag="v$version" + + if [ "$GITHUB_REF_TYPE" = "tag" ] && [ "$GITHUB_REF_NAME" != "$tag" ]; then + echo "::error::Tag $GITHUB_REF_NAME does not match app version $version" + exit 1 + fi + + if gh release view "$tag" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then + echo "Release $tag already exists, nothing to publish. Bump the version to make a new release." + publish=false + else + echo "Release $tag will be published." + publish=true + fi + + { + echo "version=$version" + echo "tag=$tag" + echo "publish=$publish" + } >> "$GITHUB_OUTPUT" + release: name: Build and publish release + needs: check + if: needs.check.outputs.publish == 'true' runs-on: ubuntu-latest timeout-minutes: 45 defaults: @@ -20,17 +70,6 @@ jobs: steps: - uses: actions/checkout@v5 - - name: Check tag matches app version - id: version - run: | - tag="${GITHUB_REF_NAME#v}" - app_version=$(sed -n 's/.*ClientVersion\.validate("\([^"]*\)").*/\1/p' app/build.gradle.kts) - if [ "$tag" != "$app_version" ]; then - echo "::error::Tag $GITHUB_REF_NAME does not match versionName $app_version in app/build.gradle.kts" - exit 1 - fi - echo "name=$app_version" >> "$GITHUB_OUTPUT" - - uses: actions/setup-java@v5 with: distribution: temurin @@ -63,14 +102,14 @@ jobs: - name: Collect artifacts env: - VERSION: ${{ steps.version.outputs.name }} + VERSION: ${{ needs.check.outputs.version }} run: | mkdir -p dist for flavor in foss gms; do cp "app/build/outputs/apk/$flavor/release/app-$flavor-release.apk" "dist/hho-$VERSION-$flavor.apk" done cd dist - sha256sum *.apk > SHA256SUMS + sha256sum -- *.apk > SHA256SUMS - name: Remove keystore if: always() @@ -79,10 +118,11 @@ jobs: - name: Publish GitHub release env: GH_TOKEN: ${{ github.token }} - VERSION: ${{ steps.version.outputs.name }} + TAG: ${{ needs.check.outputs.tag }} + VERSION: ${{ needs.check.outputs.version }} run: | - gh release create "$GITHUB_REF_NAME" \ + gh release create "$TAG" \ + --target "$GITHUB_SHA" \ --title "$VERSION" \ --generate-notes \ - --verify-tag \ dist/*.apk dist/SHA256SUMS From 6341d3ef7bbd551cbb451d667bca3dbe0a743d2a Mon Sep 17 00:00:00 2001 From: ankek Date: Thu, 1 Oct 2026 08:32:52 +0300 Subject: [PATCH 2/2] update version --- android-app/app/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android-app/app/build.gradle.kts b/android-app/app/build.gradle.kts index dc5863e..aaaa902 100644 --- a/android-app/app/build.gradle.kts +++ b/android-app/app/build.gradle.kts @@ -11,7 +11,7 @@ plugins { alias(libs.plugins.openapi.generator) } -val hhoClientVersion = ClientVersion.validate("0.1.0") +val hhoClientVersion = ClientVersion.validate("0.1.2") val releaseKeystore = providers.environmentVariable("HHO_KEYSTORE_FILE") .orElse(providers.gradleProperty("hho.keystore.file"))