Create gradle.yml #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created | ||
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle | ||
- name: Cache | ||
uses: actions/[email protected] | ||
with: | ||
# A list of files, directories, and wildcard patterns to cache and restore | ||
path: | ||
# An explicit key for restoring and saving the cache | ||
key: | ||
# An ordered list of keys to use for restoring the cache if no cache hit occurred for key | ||
restore-keys: # optional | ||
# The chunk size used to split up large files during upload, in bytes | ||
upload-chunk-size: # optional | ||
name: Gradle Package | ||
on: | ||
release: | ||
types: [created] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '11' | ||
distribution: 'temurin' | ||
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml | ||
settings-path: ${{ github.workspace }} # location for the settings.xml file | ||
- name: Build with Gradle | ||
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1 | ||
with: | ||
arguments: build | ||
name: Setup Java JDK | ||
uses: actions/[email protected] | ||
with: | ||
# The Java version to make available on the path. Takes a whole or semver Java version, or 1.x syntax (e.g. 1.8 => Java 8.x). Early access versions can be specified in the form of e.g. 14-ea, 14.0.0-ea, or 14.0.0-ea.28 | ||
java-version: | ||
# The package type (jre, jdk, jdk+fx) | ||
java-package: # optional, default is jdk | ||
# The architecture (x86, x64) of the package. | ||
architecture: # optional, default is x64 | ||
# Path to where the compressed JDK is located. The path could be in your source repository or a local path on the agent. | ||
jdkFile: # optional | ||
# ID of the distributionManagement repository in the pom.xml file. Default is `github` | ||
server-id: # optional, default is github | ||
# Environment variable name for the username for authentication to the Apache Maven repository. Default is $GITHUB_ACTOR | ||
server-username: # optional, default is GITHUB_ACTOR | ||
# Environment variable name for password or token for authentication to the Apache Maven repository. Default is $GITHUB_TOKEN | ||
server-password: # optional, default is GITHUB_TOKEN | ||
# Path to where the settings.xml file will be written. Default is ~/.m2. | ||
settings-path: # optional | ||
# GPG private key to import. Default is empty string. | ||
gpg-private-key: # optional | ||
# Environment variable name for the GPG private key passphrase. Default is $GPG_PASSPHRASE. | ||
gpg-passphrase: # optional | ||
# The USERNAME and TOKEN need to correspond to the credentials environment variables used in | ||
# the publishing section of your build.gradle | ||
- name: Publish to GitHub Packages | ||
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1 | ||
with: | ||
arguments: publish | ||
env: | ||
USERNAME: ${{ github.actor }} | ||
TOKEN: ${{ secrets.GITHUB_TOKEN }} |