Skip to content

Commit

Permalink
Prepare for publication
Browse files Browse the repository at this point in the history
  • Loading branch information
serras committed Sep 25, 2022
1 parent 531d48b commit 166c7fd
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Set up Java
uses: actions/[email protected]
with:
distribution: 'zulu'
distribution: 'adopt'
java-version: 11

- name: build
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Publish package to Maven Central
on:
release:
types: [created]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'adopt'
- name: Validate Gradle wrapper
uses: gradle/[email protected]
- name: Publish package
uses: gradle/[email protected]
with:
arguments: -Pversion=${{ env.GITHUB_REF_NAME }} publish
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ plugins {
}

group = "at.kopyk"
version = "0.1"
version = "1.0-SNAPSHOT"
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package buildsrc.conventions

import java.net.URI

plugins {
`maven-publish`
}
Expand Down Expand Up @@ -29,6 +31,17 @@ publishing {
}
}
}

repositories {
maven {
name = "OSSRH"
url = URI("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
}

plugins.withType<JavaPlugin>().configureEach {
Expand Down

0 comments on commit 166c7fd

Please sign in to comment.