Skip to content

Commit

Permalink
#8, add publishing section to build gradle file (#13)
Browse files Browse the repository at this point in the history
* #8, add publishing section to build gradle file

* update build file
  • Loading branch information
noebrito authored Apr 1, 2020
1 parent df61f7d commit 61904cc
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ on:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.11
Expand All @@ -21,3 +19,22 @@ jobs:
run: chmod +x gradlew
- name: Build with Gradle
run: gradle clean build
- name: Publish package
run: gradle publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs: build
name: Publish Jar To Github Registry
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 1.11
- name: Publish package
run: gradle publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

15 changes: 15 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
plugins {
id 'java'
id 'java-library'
id 'maven-publish'
}

group 'com.noebrito'
Expand All @@ -25,3 +27,16 @@ dependencies {
test {
useJUnitPlatform()
}

publishing {
repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/noebrito/openbrewerydb-java"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}

0 comments on commit 61904cc

Please sign in to comment.