diff --git a/.github/workflows/build-apk.yml b/.github/workflows/build-apk.yml index c2cb2f0..6a2933f 100644 --- a/.github/workflows/build-apk.yml +++ b/.github/workflows/build-apk.yml @@ -1,24 +1,11 @@ name: Build APK on: - push: - branches: - - main - - claude/main-bugs-review-nd8dax - tags: - - "v*" workflow_dispatch: - inputs: - release_tag: - description: "Tag to publish as a GitHub Release (e.g. v2.0.2). Leave empty to just build." - required: false - default: "" jobs: build: runs-on: ubuntu-latest - permissions: - contents: write steps: - name: Checkout uses: actions/checkout@v4 @@ -57,11 +44,3 @@ jobs: name: TurnProxy-apk path: app/build/outputs/apk/release/*.apk if-no-files-found: error - - - name: Publish GitHub Release - if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && inputs.release_tag != '') - uses: softprops/action-gh-release@v2 - with: - tag_name: ${{ startsWith(github.ref, 'refs/tags/v') && github.ref_name || inputs.release_tag }} - files: app/build/outputs/apk/release/*.apk - generate_release_notes: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5edb597 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,52 @@ +name: Publish Release + +on: + workflow_dispatch: + inputs: + tag: + description: "Release tag to create/publish (e.g. v2.0.2)" + required: true + +jobs: + release: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: "17" + + - name: Set up Android SDK + uses: android-actions/setup-android@v3 + + - name: Install required SDK packages + run: sdkmanager "platforms;android-36" "build-tools;36.0.0" + + - name: Cache Gradle + uses: actions/cache@v4 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', 'gradle/wrapper/gradle-wrapper.properties') }} + restore-keys: | + gradle-${{ runner.os }}- + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build release APK + run: ./gradlew assembleRelease --stacktrace + + - name: Publish GitHub Release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ inputs.tag }} + files: app/build/outputs/apk/release/*.apk + generate_release_notes: true