From e84d3ce7ccde3032b7da39410ebc18246516c7d0 Mon Sep 17 00:00:00 2001 From: djoeni Date: Thu, 16 Jun 2022 14:24:43 +0700 Subject: [PATCH] Switch Upstream --- .../workflows/build-pre-release-unsigned.yaml | 61 +++++++++++++++++++ .github/workflows/build-unsigned.yaml | 25 +------- .gitmodules | 1 + build.gradle.kts | 16 ++--- core/build.gradle.kts | 6 +- 5 files changed, 75 insertions(+), 34 deletions(-) create mode 100644 .github/workflows/build-pre-release-unsigned.yaml diff --git a/.github/workflows/build-pre-release-unsigned.yaml b/.github/workflows/build-pre-release-unsigned.yaml new file mode 100644 index 00000000..197725f8 --- /dev/null +++ b/.github/workflows/build-pre-release-unsigned.yaml @@ -0,0 +1,61 @@ +name: build_prerelease +on: + workflow_dispatch: + +jobs: + BuildPreRelease: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 17 + + - name: Setup Go + uses: actions/setup-go@v3 + with: + go-version: 1.18 + + - uses: actions/cache@v3 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + + - name: PreRelease Build + if: success() + uses: gradle/gradle-build-action@v2 + with: + arguments: --no-daemon app:assembleMeta-AlphaRelease + + - name: Delete current release assets + uses: andreaswilli/delete-release-assets-action@v2.0.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + tag: Prerelease-${{ github.ref_name }} + deleteOnlyFromDrafts: false + - name: Tag Repo + uses: richardsimko/update-tag@v1 + with: + tag_name: Prerelease-${{ github.ref_name }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload Alpha + uses: softprops/action-gh-release@v1 + if: ${{ success() }} + with: + tag: ${{ github.ref_name }} + tag_name: Prerelease-${{ github.ref_name }} + files: app/build/outputs/apk/foss/release/* + prerelease: true + generate_release_notes: true diff --git a/.github/workflows/build-unsigned.yaml b/.github/workflows/build-unsigned.yaml index 31e47eaf..92d565b0 100644 --- a/.github/workflows/build-unsigned.yaml +++ b/.github/workflows/build-unsigned.yaml @@ -1,27 +1,6 @@ name: Build Unsigned on: - push: - branches: - - main - paths-ignore: - - '.github/**' - - '.idea/**' - - '.gitattributes' - - '.gitignore' - - '.gitmodules' - - '**.md' - - 'LICENSE' - - 'NOTICE' - pull_request: - paths-ignore: - - '.github/**' - - '.idea/**' - - '.gitattributes' - - '.gitignore' - - '.gitmodules' - - '**.md' - - 'LICENSE' - - 'NOTICE' + workflow_dispatch: jobs: BuildUnsigned: @@ -51,4 +30,4 @@ jobs: - name: Build uses: gradle/gradle-build-action@v2 with: - arguments: --no-daemon app:assembleFossRelease + arguments: --no-daemon app:assembleMeta-AlphaRelease diff --git a/.gitmodules b/.gitmodules index 21fdbf29..ba153e8f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ [submodule "clash-foss"] path = core/src/foss/golang/clash url = https://github.com/MetaCubeX/Clash.Meta + branch = android-open diff --git a/build.gradle.kts b/build.gradle.kts index d7df976f..a6715199 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -34,7 +34,7 @@ subprojects { extensions.configure { defaultConfig { if (isApp) { - applicationId = "com.github.metacubex.clash" + applicationId = "com.github.kr328.clash" } minSdk = 21 @@ -55,7 +55,7 @@ subprojects { if (!isApp) { consumerProguardFiles("consumer-rules.pro") } else { - setProperty("archivesBaseName", "cfa-$versionName") + setProperty("archivesBaseName", "cmfa-$versionName") } } @@ -72,21 +72,21 @@ subprojects { productFlavors { flavorDimensions("feature") - create("meta") { + create("meta-alpha") { isDefault = true dimension = flavorDimensionList[0] - versionNameSuffix = ".meta" + versionNameSuffix = ".Meta-Alpha" - buildConfigField("boolean", "PREMIUM", "Boolean.parseBoolean(\"false\")") + buildConfigField("boolean", "PREMIUM", "Boolean.parseBoolean(\"true\")") if (isApp) { - applicationIdSuffix = ".meta" + applicationIdSuffix = ".foss" } } } sourceSets { - getByName("meta") { + getByName("meta-alpha") { java.srcDirs("src/foss/java") } } @@ -155,4 +155,4 @@ tasks.wrapper { file("gradle/wrapper/gradle-wrapper.properties") .appendText("distributionSha256Sum=$sha256") } -} \ No newline at end of file +} diff --git a/core/build.gradle.kts b/core/build.gradle.kts index de8a2205..4d7421c2 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -12,14 +12,14 @@ plugins { } val geoipDatabaseUrl = - "https://github.com/Dreamacro/maxmind-geoip/releases/latest/download/Country.mmdb" + "https://raw.githubusercontent.com/Loyalsoldier/geoip/release/Country.mmdb" val geoipInvalidate = Duration.ofDays(7)!! val geoipOutput = buildDir.resolve("intermediates/golang_blob") val golangSource = file("src/main/golang/native") golang { sourceSets { - create("meta") { + create("meta-alpha") { tags.set(listOf("foss")) srcDir.set(file("src/foss/golang")) } @@ -110,4 +110,4 @@ afterEvaluate { it.dependsOn(downloadTask) } } -} \ No newline at end of file +}