Skip to content

Commit

Permalink
Publishing to GitHub Packages (#22)
Browse files Browse the repository at this point in the history
* Update build.gradle for with publishing setup
* Add publish workflow

Signed-off-by: eliflores <[email protected]>
  • Loading branch information
eliflores authored May 10, 2022
1 parent ee598ed commit 82b23da
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 4 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Publish package to GitHub Packages
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v1
with:
java-version: 14
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Publish package
uses: gradle/gradle-build-action@v2
with:
arguments: publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24 changes: 20 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,31 @@ dependencies {
testImplementation 'com.github.tomakehurst:wiremock:2.27.2'
}

group = 'com.github.eliflores.tools'
version = '0.1-SNAPSHOT'
description = 'eliflores-little-tools'
java.sourceCompatibility = JavaVersion.VERSION_14

publishing {
publications {
maven(MavenPublication) {
from(components.java)
groupId = 'com.github.eliflores.tools'
artifactId = 'eliflores-little-tools'
version = "0.1-SNAPSHOT"
from components.java

pom {
name = 'eliflores-little-tools'
description = 'Little tools in Java that could be useful, from time to time.'
}
}
}

repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/eliflores/little-tools-java"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
Expand Down

0 comments on commit 82b23da

Please sign in to comment.