Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Merge branch dev to main #2406

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 76 additions & 56 deletions .github/workflows/build_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,42 @@ name: Build pull request
on:
workflow_dispatch:
inputs:
# Enable or disable cache
flutter-cache:
description: Cache
type: boolean
default: true

# Select app flavour
app-flavour:
description: App flavour
# Select pull request
pr-number:
description: PR number (Without hashtag)
required: true
# Select app flavor
app-flavor:
description: App flavor
default: 'release'
type: choice
options:
options:
- release
- debug
- profile

# Select pull request
pr-number:
description: PR number (Without hashtag)
required: true

# Flutter Configurations,
# it's recommended to be set when you have problem regarding with flutter itself
# For most part you do not need to change this.

# Flutter version to use, note that the version had to exist in whether channel
# to grab
# Try using exact version or particular version on a specific branch instead of "any"
flutter-channel:
description: Flutter channel
default: 'stable'
type: choice
options:
- stable
- beta
- dev
- any
flutter-version:
description: Flutter version
default: '3.29.x'

run-name: "Build pull request ${{ inputs.pr-number }}"

jobs:
build:
name: Build
Expand All @@ -34,84 +47,91 @@ jobs:
contents: read
pull-requests: write
steps:
- name: Setup pull request
env:
GH_TOKEN: ${{ github.token }}
run: |
gh repo clone "${{ github.repository }}"
cd revanced-manager
gh repo set-default "${{ github.repository }}"
gh pr checkout "${{ inputs.pr-number }}"

echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV

- name: Checkout
- name: Checkout PR
uses: actions/checkout@v4
with:
persist-credentials: false
ref: refs/pull/${{ inputs.pr-number }}/merge
fetch-depth: 0

- name: Cache Gradle
uses: burrunan/gradle-cache-action@v2

- name: Setup Java
run: echo "JAVA_HOME=$JAVA_HOME_17_X64" >> $GITHUB_ENV
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: 3.24.x
cache: ${{ inputs.flutter-cache }}
channel: ${{ inputs.flutter-channel }}
flutter-version: ${{ inputs.flutter-version }}

- name: Get dependencies
continue-on-error: true
run: flutter pub get

- name: Generate translations
continue-on-error: true
run: dart run slang

- name: Generate code files
continue-on-error: true
run: dart run build_runner build --delete-conflicting-outputs

- name: Build
continue-on-error: true
id: flutter-build
env:
run: flutter build apk --${{ inputs.app-flavor }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
flutter build apk --"${{ inputs.app-flavour }}";

- name: Prepare comment
id: prepare-comment # This should work now?
run: |
echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
if [[ "${{ steps.flutter-build.outcome }}" == "success" ]]; then
echo "MESSAGE=✅ Succeeded build on ${{ env.COMMIT_HASH }}." >> $GITHUB_ENV
MESSAGE="✅ Succeeded build on $COMMIT_HASH."
else
echo "MESSAGE=🚫 Failed build on ${{ env.COMMIT_HASH }}." >> $GITHUB_ENV
MESSAGE="🚫 Failed build on $COMMIT_HASH."
fi

- name: "Comment on pull request #${{ inputs.pr-number }}"
uses: thollander/actions-comment-pull-request@v2
uses: thollander/actions-comment-pull-request@v3
with:
GITHUB_TOKEN: ${{ github.token }}
pr_number: ${{ inputs.pr-number }}
github-token: ${{ github.token }}
pr-number: ${{ inputs.pr-number }}
mode: recreate
comment-tag: execution
message: |
## ⚒️ Build status

${{ env.MESSAGE }}

Details: [${{ github.run_id }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})!

### ⚙️ Workflow run configuration
🧪 Workflow triggered by: ${{ github.actor }}

${{ steps.prepare-comment.outputs.MESSAGE }}

Details: [_Job execution **${{ github.run_id }}** / attempt **${{ github.run_attempt }}**_](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})!

### ⚙️ Workflow Steps

| Step | Status |
| :------------------------ | :------------------------------------------------------- |
| **Get dependencies** | ${{ steps.get-dependencies.outcome || job.status }} |
| **Generate translations** | ${{ steps.generate-translations.outcome || job.status }} |
| **Generate code files** | ${{ steps.generate-code-files.outcome || job.status }} |
| **Build** | ${{ steps.flutter-build.outcome }} |

### ⚙️ Workflow Configuration

- Flutter cache: ${{ inputs.flutter-cache }}
- App flavor: ${{ inputs.app-flavour }}
| Parameter | Value |
| :--------------- | :--------------------------------------- |
| App flavor | ${{ inputs.app-flavor }} |
| Flutter version | ${{ inputs.flutter-version }} |
| Flutter channel | ${{ inputs.flutter-channel }} |

- name: Upload
- name: Upload Artifact
if: steps.flutter-build.outcome == 'success'
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: revanced-manager-(${{ env.COMMIT_HASH }}-${{ inputs.pr-number }}-${{ inputs.app-flavour }})
name: revanced-manager-(${{ env.COMMIT_HASH }}-${{ inputs.pr-number }}-${{ inputs.app-flavor }}-${{ inputs.flutter-version }})
path: |
build/app/outputs/flutter-apk/app-${{ inputs.app-flavour }}.apk
build/app/outputs/flutter-apk/app-${{ inputs.app-flavour }}.apk.sha1
build/app/outputs/flutter-apk/app-${{ inputs.app-flavor }}.apk
build/app/outputs/flutter-apk/app-${{ inputs.app-flavor }}.apk.sha1
10 changes: 9 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ jobs:
release:
name: Release
permissions:
contents: write
id-token: write
contents: write
attestations: write
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -63,3 +65,9 @@ jobs:
KEYSTORE_ENTRY_PASSWORD: ${{ secrets.KEYSTORE_ENTRY_PASSWORD }}
run: |
npx semantic-release

- name: Generate artifact attestation
if: github.ref == 'refs/heads/main'
uses: actions/attest-build-provenance@v1
with:
subject-path: build/app/outputs/apk/release/revanced-manager-*.apk
5 changes: 2 additions & 3 deletions .github/workflows/sync_crowdin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:
uses: subosito/flutter-action@v2
with:
cache: true
flutter-version: 3.27.x

- name: Sync translations from Crowdin
uses: crowdin/github-action@v2
Expand Down Expand Up @@ -59,13 +58,13 @@ jobs:
dart run slang analyze
dart run slang clean
dart run slang normalize

dart run slang

cd assets/i18n
dart nuke.dart >> $GITHUB_STEP_SUMMARY
cd ../..

dart run slang

flutter analyze lib/gen/strings.g.dart --no-fatal-infos --no-fatal-warnings

- name: Commit translations
Expand Down
1 change: 0 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ linter:
- unnecessary_string_interpolations
- unnecessary_this
- unrelated_type_equality_checks
- unsafe_html
- use_build_context_synchronously
- use_full_hex_values_for_flutter_colors
- use_function_type_syntax_for_parameters
Expand Down
18 changes: 9 additions & 9 deletions android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ plugins {
android {
namespace = "app.revanced.manager.flutter"
compileSdk = 35
ndkVersion = "27.0.12077973"

compileOptions {
isCoreLibraryDesugaringEnabled = true
Expand Down Expand Up @@ -46,7 +45,7 @@ android {

signingConfig = signingConfigs["debug"]

ndk.abiFilters += setOf("armeabi-v7a", "arm64-v8a", "x86_64")
ndk.abiFilters += listOf("armeabi-v7a", "arm64-v8a", "x86_64")
}

release {
Expand All @@ -64,19 +63,22 @@ android {

resValue("string", "app_name", "ReVanced Manager")
} else {
applicationIdSuffix = ".debug"

applicationIdSuffix = ".development"
resValue("string", "app_name", "ReVanced Manager (Development)")
signingConfig = signingConfigs["debug"]

resValue("string", "app_name", "ReVanced Manager (Debug signed)")
}
}

debug {
applicationIdSuffix = ".debug"

resValue("string", "app_name", "ReVanced Manager (Debug)")
}

named("profile") {
initWith(getByName("debug"))
applicationIdSuffix = ".profile"
resValue("string", "app_name", "ReVanced Manager (Profile)")
}
}

packaging {
Expand All @@ -91,7 +93,6 @@ android {
}
}


flutter {
source = "../.."
}
Expand All @@ -101,4 +102,3 @@ dependencies {
implementation(libs.revanced.patcher)
implementation(libs.revanced.library)
}

4 changes: 2 additions & 2 deletions android/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
revanced-patcher = "21.0.0"
revanced-library = "3.0.2"
desugar_jdk_libs = "2.1.3"
revanced-library = "3.1.0"
desugar_jdk_libs = "2.1.4"

[libraries]
revanced-patcher = { module = "app.revanced:revanced-patcher", version.ref = "revanced-patcher" }
Expand Down
4 changes: 2 additions & 2 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=5b9c5eb3f9fc2c94abaea57d90bd78747ca117ddbbf96c859d3741181a12bf2a
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
distributionSha256Sum=8d97a97984f6cbd2b85fe4c60a743440a347544bf18818048e611f5288d46c94
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
4 changes: 2 additions & 2 deletions android/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ pluginManagement {

plugins {
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
id("com.android.application") version "8.7.2" apply false
id("org.jetbrains.kotlin.android") version "2.0.20" apply false
id("com.android.application") version "8.8.0" apply false
id("org.jetbrains.kotlin.android") version "2.1.10" apply false
}

include(":app")
2 changes: 1 addition & 1 deletion lib/ui/widgets/settingsView/about_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class _AboutWidgetState extends State<AboutWidget> {
ClipboardData(
text: 'Version: ${snapshot.data!['version']}\n'
'Model: ${snapshot.data!['model']}\n'
'Android Version: ${snapshot.data!['androidVersion']}\n'
'Android version: ${snapshot.data!['androidVersion']}\n'
'${snapshot.data!['supportedArch'].length > 1 ? 'Supported Archs' : 'Supported Arch'}: ${snapshot.data!['supportedArch'].join(", ")}\n',
),
);
Expand Down
Loading
Loading