Skip to content

Build Java project with Gradle, extract metadata, and publish artifacts to a repository.

License

Notifications You must be signed in to change notification settings

RiV-chain/github-publish-maven-action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

github-publish-maven-action

Build Java project with Gradle, extract metadata, and publish artifacts to a repository.

Usage in a Workflow

You can use this action in your workflows. Here's an example of how to use it:

name: Build and Publish

on:
  workflow_dispatch:

jobs:
  build-and-publish:
    runs-on: ubuntu-latest
    steps:
      - name: Use Maven publish action
        uses: RiV-chain/github-publish-maven-action@main
        with:
          gh_pat: ${{ secrets.PAT }}
          artifact_repo: 'RiV-chain/artifact'
          gradle_file_path: './gradlew'
          java_version: '8'
          distribution: 'adopt'
  1. Add following lines in build.gradle build script:
publishing {
    repositories {
        mavenLocal()
    }
    publications {
        gpr(MavenPublication) {
            from(components.java)
        }
    }
}
  1. Register secret.PAT with permission for you Maven repo and replace the path it in artifact_repo parameter.

  2. Add your repo URL in build.gradle. Your Maven repo will have path https://github.com/<username>/<repo>/raw/<branch>. Example repo.

    repositories {
        maven {
            url "https://github.com/RiV-chain/artifact/raw/main"
        }
    }

Notes:

About

Build Java project with Gradle, extract metadata, and publish artifacts to a repository.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published