Skip to content

Commit

Permalink
Add package publication
Browse files Browse the repository at this point in the history
  • Loading branch information
vadyushkins committed Apr 18, 2023
1 parent 827deb2 commit 2feaec4
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 3 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ on:
release:
types: [ created ]

env:
GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
contents: write
packages: write
steps:
- name: Checkout
Expand All @@ -24,5 +27,17 @@ jobs:
uses: gradle/gradle-build-action@v2
with:
arguments: publish
cache-read-only: |
${{ github.ref != 'refs/heads/main' &&
github.ref != 'refs/heads/dev' }}
gradle-home-cache-includes: |
caches
notifications
jdks
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Release
uses: softprops/action-gh-release@v1
with:
files: build/libs/kotgll-*.jar
30 changes: 29 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
`maven-publish`
}

group = "me.vadyushkins"
group = "vadyushkins"

version = "1.0.0"

Expand Down Expand Up @@ -34,6 +34,34 @@ tasks.withType<Jar> {
}

publishing {
publications {
create<MavenPublication>("kotgll") {
from(components["java"])

versionMapping {
usage("java-api") { fromResolutionOf("runtimeClasspath") }
usage("java-runtime") { fromResolutionResult() }
}

pom {
name.set("kotgll")
url.set("https://github.com/vadyushkins/kotgll")
licenses {
license {
name.set("MIT License")
url.set("https://github.com/vadyushkins/kotgll/blob/main/LICENSE")
}
}
developers {
developer {
id.set("vadyushkins")
name.set("Vadim Abzalov")
email.set("vadim.i.abzalov@gmail.com")
}
}
}
}
}
repositories {
maven {
name = "GitHubPackages"
Expand Down

0 comments on commit 2feaec4

Please sign in to comment.