Skip to content

Commit 061c630

Browse files
committed
Merge remote-tracking branch 'origin/compose-dev' into fix-icons-compose
# Conflicts: # .github/workflows/release.yml # api/build.gradle.kts # app/.releaserc # app/build.gradle.kts # app/src/main/res/drawable/ic_launcher_round.png # app/src/main/res/mipmap-hdpi/ic_launcher.png # app/src/main/res/mipmap-mdpi/ic_launcher.png # app/src/main/res/mipmap-xhdpi/ic_launcher.png # app/src/main/res/mipmap-xxhdpi/ic_launcher.png # app/src/main/res/mipmap-xxxhdpi/ic_launcher.png # docs/2_3_managing_patches.md # gradle.properties # gradle/libs.versions.toml # package-lock.json # package.json
2 parents d405cd1 + 8d9c243 commit 061c630

18 files changed

+1027
-864
lines changed

.github/workflows/release.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
name: Release
1313
permissions:
1414
contents: write
15+
packages: write
1516
id-token: write
1617
attestations: write
1718
runs-on: ubuntu-latest
@@ -26,10 +27,11 @@ jobs:
2627
java-version: '17'
2728

2829
- name: Cache Gradle
29-
uses: burrunan/gradle-cache-action@v1
30+
uses: burrunan/gradle-cache-action@v3
3031

3132
- name: Build
3233
env:
34+
GITHUB_ACTOR: ${{ github.actor }}
3335
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3436
run: ./gradlew assembleRelease
3537

@@ -53,18 +55,26 @@ jobs:
5355
run: |
5456
echo "${{ secrets.KEYSTORE }}" | base64 --decode > "app/keystore.jks"
5557
56-
- name: Semantic Release
57-
uses: cycjimmy/semantic-release-action@v4
58-
id: semantic
58+
- name: Release API
59+
run: npx multi-semantic-release --tag-format 'api@${version}' --ignore-packages app
5960
env:
61+
GITHUB_ACTOR: ${{ github.actor }}
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
64+
- name: Release
65+
id: release
66+
run: |
67+
echo "NEW_TAG=$(npx multi-semantic-release --tag-format 'v${version}' --ignore-packages api | tee | grep 'Created tag ' | sed -E 's/.*Created tag ([^ ]+).*/\1/')" >> $GITHUB_OUTPUT
68+
env:
69+
GITHUB_ACTOR: ${{ github.actor }}
6070
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6171
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
6272
KEYSTORE_ENTRY_ALIAS: ${{ secrets.KEYSTORE_ENTRY_ALIAS }}
6373
KEYSTORE_ENTRY_PASSWORD: ${{ secrets.KEYSTORE_ENTRY_PASSWORD }}
6474

6575
- name: Attest
66-
if: steps.semantic.outputs.new_release_published == 'true'
76+
if: steps.release.outputs.NEW_TAG != ''
6777
uses: actions/attest-build-provenance@v2
6878
with:
69-
subject-name: 'ReVanced Manager ${{ steps.release.outputs.new_release_git_tag }}'
79+
subject-name: 'ReVanced Manager ${{ steps.release.outputs.NEW_TAG }}'
7080
subject-path: app/build/outputs/apk/release/revanced-manager*.apk

adsfund.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"info": "This is verification file for ads.fund project",
3+
"project": {
4+
"name": "ReVanced Manager",
5+
"walletAddress": "0x7ab4091e00363654bf84B34151225742cd92FCE5",
6+
"tokenAddress": "0xadf954bc6f509b3a32fb5e97ed4ba6c000e37155"
7+
}
8+
}

api/.releaserc

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"branches": [
3+
"main",
4+
{
5+
"name": "dev",
6+
"prerelease": true
7+
}
8+
],
9+
"plugins": [
10+
[
11+
"@semantic-release/commit-analyzer",
12+
{
13+
"releaseRules": [
14+
{ "type": "build", "scope": "Needs bump", "release": "patch" }
15+
]
16+
}
17+
],
18+
"@semantic-release/release-notes-generator",
19+
"@semantic-release/changelog",
20+
"gradle-semantic-release-plugin",
21+
[
22+
"@semantic-release/git",
23+
{
24+
"assets": [
25+
"CHANGELOG.md",
26+
"gradle.properties"
27+
],
28+
"message": "chore: Release API v${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
29+
}
30+
],
31+
[
32+
"@saithodev/semantic-release-backmerge",
33+
{
34+
"backmergeBranches": [{"from": "main", "to": "dev"}],
35+
"clearWorkspace": true
36+
}
37+
]
38+
]
39+
}

api/build.gradle.kts

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import java.io.IOException
2-
31
plugins {
42
alias(libs.plugins.android.library)
53
alias(libs.plugins.kotlin.android)
@@ -19,43 +17,6 @@ dependencies {
1917
implementation(libs.appcompat)
2018
}
2119

22-
fun String.runCommand(): String {
23-
val process = ProcessBuilder(split("\\s".toRegex()))
24-
.redirectErrorStream(true)
25-
.directory(rootDir)
26-
.start()
27-
28-
val output = StringBuilder()
29-
val reader = process.inputStream.bufferedReader()
30-
31-
val thread = Thread {
32-
reader.forEachLine {
33-
output.appendLine(it)
34-
}
35-
}
36-
thread.start()
37-
38-
if (!process.waitFor(10, TimeUnit.SECONDS)) {
39-
process.destroy()
40-
throw IOException("Command timed out: $this")
41-
}
42-
43-
thread.join()
44-
return output.toString().trim()
45-
}
46-
47-
val projectPath: String = projectDir.relativeTo(rootDir).path
48-
val lastTag = "git describe --tags --abbrev=0".runCommand()
49-
val hasChangesInThisModule = "git diff --name-only $lastTag..HEAD".runCommand().lineSequence().any {
50-
it.startsWith(projectPath)
51-
}
52-
53-
tasks.matching { it.name.startsWith("publish") }.configureEach {
54-
onlyIf {
55-
hasChangesInThisModule
56-
}
57-
}
58-
5920
android {
6021
namespace = "app.revanced.manager.plugin.downloader"
6122
compileSdk = 35
@@ -147,4 +108,4 @@ publishing {
147108
signing {
148109
useGpgCmd()
149110
sign(publishing.publications["Api"])
150-
}
111+
}

api/gradlew

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../gradlew

api/package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "api",
3+
"private": false,
4+
"devDependencies": {
5+
"@anolilab/multi-semantic-release": "^1.1.10",
6+
"@saithodev/semantic-release-backmerge": "^4.0.1",
7+
"@semantic-release/changelog": "^6.0.3",
8+
"@semantic-release/git": "^10.0.1",
9+
"gradle-semantic-release-plugin": "^1.10.1"
10+
}
11+
}

.releaserc renamed to app/.releaserc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
],
99
"plugins": [
1010
[
11-
"@semantic-release/commit-analyzer", {
11+
"@semantic-release/commit-analyzer",
12+
{
1213
"releaseRules": [
1314
{ "type": "build", "scope": "Needs bump", "release": "patch" }
1415
]
@@ -22,7 +23,7 @@
2223
{
2324
"assets": [
2425
"CHANGELOG.md",
25-
"gradle.properties",
26+
"gradle.properties"
2627
],
2728
"message": "chore: Release v${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
2829
}
@@ -32,17 +33,17 @@
3233
{
3334
"assets": [
3435
{
35-
"path": "app/build/outputs/apk/release/revanced-manager*.apk?(.asc)"
36-
},
36+
"path": "build/outputs/apk/release/revanced-manager*.apk?(.asc)"
37+
}
3738
],
38-
successComment: false
39+
"successComment": false
3940
}
4041
],
4142
[
4243
"@saithodev/semantic-release-backmerge",
4344
{
44-
backmergeBranches: [{"from": "main", "to": "dev"}],
45-
clearWorkspace: true
45+
"backmergeBranches": [{"from": "main", "to": "dev"}],
46+
"clearWorkspace": true
4647
}
4748
]
4849
]

app/build.gradle.kts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import io.github.z4kn4fein.semver.toVersion
12
import kotlin.random.Random
23

34
plugins {
@@ -109,6 +110,16 @@ dependencies {
109110
implementation(libs.compose.icons.fontawesome)
110111
}
111112

113+
buildscript {
114+
repositories {
115+
mavenCentral()
116+
}
117+
dependencies {
118+
// Semantic versioning string parser
119+
classpath(libs.semver.parser)
120+
}
121+
}
122+
112123
android {
113124
namespace = "app.revanced.manager"
114125
compileSdk = 35
@@ -118,8 +129,15 @@ android {
118129
applicationId = "app.revanced.manager"
119130
minSdk = 26
120131
targetSdk = 35
121-
versionCode = 1
122-
versionName = "0.0.1"
132+
133+
val versionStr = if (version == "unspecified") "1.0.0" else version.toString()
134+
versionName = versionStr
135+
versionCode = with(versionStr.toVersion()) {
136+
major * 10_000_000 +
137+
minor * 10_000 +
138+
patch * 100 +
139+
(preRelease?.substringAfterLast('.')?.toInt() ?: 99)
140+
}
123141
vectorDrawables.useSupportLibrary = true
124142
}
125143

app/gradlew

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../gradlew

app/package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "app",
3+
"private": false,
4+
"devDependencies": {
5+
"@anolilab/multi-semantic-release": "^1.1.10",
6+
"@saithodev/semantic-release-backmerge": "^4.0.1",
7+
"@semantic-release/changelog": "^6.0.3",
8+
"@semantic-release/git": "^10.0.1",
9+
"gradle-semantic-release-plugin": "^1.10.1"
10+
}
11+
}

0 commit comments

Comments
 (0)