Skip to content

Commit

Permalink
build: Sign release artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Feb 15, 2024
1 parent 40c90f5 commit 7e7d233
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ jobs:
- name: Install dependencies
run: npm install

- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
fingerprint: ${{ env.GPG_FINGERPRINT }}

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.REPOSITORY_PUSH_ACCESS }}
Expand Down
2 changes: 1 addition & 1 deletion .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
{
"assets": [
{
"path": "build/libs/*all.jar"
"path": "build/libs/*-all*"
}
],
successComment: false
Expand Down
26 changes: 20 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
plugins {
kotlin("jvm") version "1.9.10"
alias(libs.plugins.kotlin)
alias(libs.plugins.shadow)
application
signing
}

group = "app.revanced"

application {
mainClass = "app.revanced.cli.command.MainCommandKt"
}

repositories {
mavenCentral()
mavenLocal()
google()
maven { url = uri("https://jitpack.io") }
maven {
// A repository must be speficied for some reason. "registry" is a dummy.
url = uri("https://maven.pkg.github.com/revanced/registry")
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("GITHUB_ACTOR")
password = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN")
}
}
}

dependencies {
Expand All @@ -36,9 +49,6 @@ tasks {
}

shadowJar {
manifest {
attributes("Main-Class" to "app.revanced.cli.command.MainCommandKt")
}
minimize {
exclude(dependency("org.jetbrains.kotlin:.*"))
exclude(dependency("org.bouncycastle:.*"))
Expand All @@ -61,10 +71,14 @@ tasks {
RE: https://github.com/KengoTODA/gradle-semantic-release-plugin/issues/435
*/

register<DefaultTask>("publish") {
group = "publishing"
description = "Dummy task to hack gradle-semantic-release-plugin to release ReVanced CLI"
dependsOn(build)
}
}

signing {
useGpgCmd()
sign(tasks["shadowJar"])
}

0 comments on commit 7e7d233

Please sign in to comment.