Switch Upstream

This commit is contained in:
djoeni 2022-06-16 14:24:43 +07:00
parent a5942862ff
commit e84d3ce7cc
5 changed files with 75 additions and 34 deletions

View File

@ -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

View File

@ -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

1
.gitmodules vendored
View File

@ -1,3 +1,4 @@
[submodule "clash-foss"]
path = core/src/foss/golang/clash
url = https://github.com/MetaCubeX/Clash.Meta
branch = android-open

View File

@ -34,7 +34,7 @@ subprojects {
extensions.configure<BaseExtension> {
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")
}
}
}

View File

@ -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)
}
}
}
}