Skip to content

Commit 004b590

Browse files
authored
build: Use Gradle credentials system (#6467)
1 parent f4af27d commit 004b590

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

.github/workflows/build_pull_request.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ jobs:
2525

2626
- name: Build
2727
env:
28-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
ORG_GRADLE_PROJECT_githubPackagesUsername: ${{ env.GITHUB_ACTOR }}
29+
ORG_GRADLE_PROJECT_githubPackagesPassword: ${{ secrets.GITHUB_TOKEN }}
2930
run: ./gradlew :patches:buildAndroid --no-daemon
3031

3132
- name: Upload artifacts

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ jobs:
3131

3232
- name: Build
3333
env:
34-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
ORG_GRADLE_PROJECT_githubPackagesUsername: ${{ env.GITHUB_ACTOR }}
35+
ORG_GRADLE_PROJECT_githubPackagesPassword: ${{ secrets.GITHUB_TOKEN }}
3536
run: ./gradlew :patches:buildAndroid clean
3637

3738
- name: Setup Node.js

patches/build.gradle.kts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,9 @@ kotlin {
5050
publishing {
5151
repositories {
5252
maven {
53-
name = "GitHubPackages"
53+
name = "githubPackages"
5454
url = uri("https://maven.pkg.github.com/revanced/revanced-patches")
55-
credentials {
56-
username = System.getenv("GITHUB_ACTOR")
57-
password = System.getenv("GITHUB_TOKEN")
58-
}
55+
credentials(PasswordCredentials::class)
5956
}
6057
}
6158
}

settings.gradle.kts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@ pluginManagement {
55
gradlePluginPortal()
66
google()
77
maven {
8-
name = "GitHubPackages"
8+
name = "githubPackages"
99
url = uri("https://maven.pkg.github.com/revanced/registry")
10-
credentials {
11-
username = providers.gradleProperty("gpr.user").getOrElse(System.getenv("GITHUB_ACTOR"))
12-
password = providers.gradleProperty("gpr.key").getOrElse(System.getenv("GITHUB_TOKEN"))
13-
}
10+
credentials(PasswordCredentials::class)
1411
}
1512
}
1613
}

0 commit comments

Comments
 (0)