Skip to content

Commit

Permalink
Merge pull request #3 from meisterplan/feature/github-package
Browse files Browse the repository at this point in the history
Add GitHub Packages release
  • Loading branch information
itd-ndr authored Feb 2, 2023
2 parents caca432 + eed4851 commit 507f6ad
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/github-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Release package on GitHub
on:
release:
types: [published]

jobs:
publish:
name: Publish Release on GitHub Packages
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Check that the publish plugin works
uses: gradle/gradle-build-action@v2
with:
arguments: "publish -Pversion=${{ github.event.release.name }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,31 @@ This repo contains [Detekt](https://detekt.dev/) Rules useful for developing [Me

Look up the [most recent release](https://github.com/meisterplan/detekt-rules/releases) and add the dependency to your `build.gradle.kts`:
```kotlin
dependencies {
// ...
detektPlugins("com.meisterplan:detekt-rules:VERSION")
}
```

The dependency can either be fetched from jitpack.io:
```kotlin
repositories {
// ...
maven { url = uri("https://jitpack.io") }
}
```

dependencies {
or from GitHub Packages:
```kotlin
repositories {
// ...
detektPlugins("com.meisterplan:detekt-rules:VERSION")
maven {
url = uri("https://maven.pkg.github.com/meisterplan/detekt-rules")
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") as String? ?: System.getenv("TOKEN")
}
}
}
```

Expand Down
11 changes: 11 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,15 @@ publishing {
from(components["java"])
}
}

repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/meisterplan/detekt-rules")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}

0 comments on commit 507f6ad

Please sign in to comment.