From 203550b5425c7f308974addc549848e67d7cfd70 Mon Sep 17 00:00:00 2001 From: Bryan Clark Date: Fri, 6 Dec 2019 16:21:27 -0500 Subject: [PATCH] Add Gradle example to README --- README.md | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2f6521d..a6acabf 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ jobs: - run: java -cp java HelloWorldApp ``` -Publising to an Apache Maven Repository: +Publishing using Apache Maven: ```yaml jobs: build: @@ -91,6 +91,33 @@ jobs: See the help docs on [Publishing a Package](https://help.github.com/en/github/managing-packages-with-github-packages/configuring-apache-maven-for-use-with-github-packages#publishing-a-package) for more information on the `pom.xml` file. +Publishing using Gradle: +```yaml +jobs: + + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + + - name: Build with Gradle + run: gradle build + + - name: Publish to GitHub Packages + run: gradle publish + env: + USERNAME: ${{ github.actor }} + PASSWORD: ${{ secrets.GITHUB_TOKEN }} +``` + +***NOTE: The `USERNAME` and `PASSWORD` need to correspond to the credentials environment variables used in the publishing section of your `build.gradle`..*** + +See the help docs on [Publishing a Package with Gradle](https://help.github.com/en/github/managing-packages-with-github-packages/configuring-gradle-for-use-with-github-packages#example-using-gradle-groovy-for-a-single-package-in-a-repository) for more information on the `build.gradle` configuration file. + # License The scripts and documentation in this project are released under the [MIT License](LICENSE)