Github

Deploys staged artifacts to Github Packages.

This feature does not support deploying artifacts other than JARs and POMs to a Maven compatible repository.
Publication of snapshots is not allowed.

Legend:

  • required

  • optional

  • may use environment variable

  • accepts Name Templates

  • YAML

  • TOML

  • JSON

  • Maven

  • Gradle

# 
deploy:
  maven:
    # 
    github:
      # Deployers require a name.
      # 
      app:

        # Enables or disables the deployer.
        # Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
        # Defaults to `NEVER`.
        # 
        active: ALWAYS

        # URL where the Github service is enabled.
        # If left unspecified, the `JRELEASER_GITHUB_${name}_URL`
        # environment variable must be defined.
        #  
        url: https://maven.pkg.github.com/duke/app

        # The username required for authorization.
        # If left unspecified, the `JRELEASER_GITHUB_${name}_USERNAME`
        # environment variable must be defined.
        #  
        username: __DO_NOT_SET_HERE__

        # Password for login into the GITHUB service.
        # If left unspecified, the `JRELEASER_GITHUB_${name}_PASSWORD`
        # environment variable must be defined.
        #  
        password: __DO_NOT_SET_HERE__

        # The authorization method to use.
        # Supported values are [`NONE`, `BASIC`, `BEARER`].
        # `Basic` requires both username & password.
        # `BEARER` requires a token (set as password).
        # Defaults to `BEARER`.
        # 
        authorization: BEARER

        # Signs artifacts with the configured credentials.
        # The Signing section must be configured as well.
        # Defaults to `false` unless `applyMavenCentralRules` is set to `true`.
        # 
        sign: false

        # Verifies that POM files comply with the minimum requirements for publication
        # to Maven Central. Checks fules using PomChecker.
        # Defaults to `false` unless `applyMavenCentralRules` is set to `true`.
        # 
        verifyPom: false

        # Verifies pom files, signs all artifacts, verifies that matching `-sources.jar` and
        # `-javadoc.jar` artifacts are also staged.
        # Defaults to `false`.
        # 
        applyMavenCentralRules: false

        # List of directories where staged artifacts can be found.
        # 
        stagingRepositories:
          - target/staging-deploy

        # Defines the connection timeout in seconds.
        # Defaults to `20`.
        # 
        connectTimeout: 20

        # Defines the read timeout in seconds.
        # Defaults to `60`.
        # 
        readTimeout: 60

        # Additional properties used when evaluating templates.
        # 
        extraProperties:
          # Key will be capitalized and prefixed with `github`, i.e, `githubFoo`.
          foo: bar

        # The name of the repository.
        # If unspecified, will use ${release.${releaser}.name}.
        # 
        repository: app
# Deployers require a name.
# 
[deploy.maven.github.app]

  # Enables or disables the deployer.
  # Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
  # Defaults to `NEVER`.
  # 
  active = "ALWAYS"

  # URL where the Github service is enabled.
  # If left unspecified, the `JRELEASER_GITHUB_${name}_URL`
  # environment variable must be defined.
  #  
  url = "https://maven.pkg.github.com/duke/app"

  # The username required for authorization.
  # If left unspecified, the `JRELEASER_GITHUB_${name}_USERNAME`
  # environment variable must be defined.
  #  
  username = "__DO_NOT_SET_HERE__"

  # Password for login into the GITHUB service..
  # If left unspecified, the `JRELEASER_GITHUB_${name}_PASSWORD`
  # environment variable must be defined.
  #  
  password = "__DO_NOT_SET_HERE__"

  # The authorization method to use.
  # Supported values are [`NONE`, `BASIC`, `BEARER`].
  # `Basic` requires both username & password.
  # `BEARER` requires a token (set as password).
  # Defaults to `BEARER`.
  # 
  authorization = "BEARER"

  # Signs artifacts with the configured credentials.
  # The Signing section must be configured as well.
  # Defaults to `false` unless `applyMavenCentralRules` is set to `true`.
  # 
  sign = false

  # Verifies that POM files comply with the minimum requirements for publication
  # to Maven Central. Checks fules using PomChecker.
  # Defaults to `false` unless `applyMavenCentralRules` is set to `true`.
  # 
  verifyPom = false

  # Verifies pom files, signs all artifacts, verifies that matching `-sources.jar` and
  # `-javadoc.jar` artifacts are also staged.
  # Defaults to `false`.
  # 
  applyMavenCentralRules = false

  # List of directories where staged artifacts can be found.
  # 
  stagingRepositories = ["target/staging-deploy"]

  # Defines the connection timeout in seconds.
  # Defaults to `20`.
  # 
  connectTimeout = 20

  # Defines the read timeout in seconds.
  # Defaults to `60`.
  # 
  readTimeout = 60

  # Additional properties used when evaluating templates.
  # 
  extraProperties.foo = "bar"
  # Key will be capitalized and prefixed with `github`, i.e, `githubFoo`.

  # The name of the repository.
  # If unspecified, will use ${release.${releaser}.name}.
  # 
  repository = "app"
{
  // 
  "deploy": {
    "maven": {
      // 
      "github": {
        // Deployers require a name.
        // 
        "app": {

          // Enables or disables the deployer.
          // Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
          // Defaults to `NEVER`.
          // 
          "active": "ALWAYS",

          // URL where the Github service is enabled.
          // If left unspecified, the `JRELEASER_GITHUB_${name}_URL`
          // environment variable must be defined.
          //  
          "url": "https://maven.pkg.github.com/duke/app",

          // The username required for authorization.
          // If left unspecified, the `JRELEASER_GITHUB_${name}_USERNAME`
          // environment variable must be defined.
          //  
          "username": "__DO_NOT_SET_HERE__",

          // Password for login into the GITHUB service.
          // If left unspecified, the `JRELEASER_GITHUB_${name}_PASSWORD`
          // environment variable must be defined.
          //  
          "password": "__DO_NOT_SET_HERE__",

          // The authorization method to use.
          // Supported values are [`NONE`, `BASIC`, `BEARER`].
          // `Basic` requires both username & password.
          // `BEARER` requires a token (set as password).
          // Defaults to `BEARER`.
          // 
          "authorization": "BEARER",

          // Signs artifacts with the configured credentials.
          // The Signing section must be configured as well.
          // Defaults to `false` unless `applyMavenCentralRules` is set to `true`.
          // 
          "sign": false,

          // Verifies that POM files comply with the minimum requirements for publication
          // to Maven Central. Checks fules using PomChecker.
          // Defaults to `false` unless `applyMavenCentralRules` is set to `true`.
          // 
          "verifyPom": false,

          // Verifies pom files, signs all artifacts, verifies that matching `-sources.jar` and
          // `-javadoc.jar` artifacts are also staged.
          // Defaults to `false`.
          // 
          "applyMavenCentralRules": false,

          // List of directories where staged artifacts can be found.
          // 
          "stagingRepositories": [
            "target/staging-deploy"
          ],

          // Defines the connection timeout in seconds.
          // Defaults to `20`.
          // 
          "connectTimeout": 20,

          // Defines the read timeout in seconds.
          // Defaults to `60`.
          // 
          "readTimeout": 60,

          // The name of the repository.
          // If unspecified, will use ${release.${releaser}.name}.
          // 
          "repository": "app",

          // Additional properties used when evaluating templates.
          // 
          "extraProperties": {
            // Key will be capitalized and prefixed with `github`, i.e, `githubFoo`.
            "foo": "bar"
          }
        }
      }
    }
  }
}
<jreleaser>
  <!--
    
  -->
  <deploy>
    <maven>
      <!--
        
      -->
      <github>
        <!--
          Deployers require a name.
          
        -->
        <app>
          <!--
            Enables or disables the distribution.
            Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
            Defaults to `NEVER`.
            
          -->
          <active>ALWAYS</active>

          <!--
            URL where the Github service is enabled.
            If left unspecified, the `JRELEASER_GITHUB_${name}_URL`
            environment variable must be defined.
             
          -->
          <url>https://maven.pkg.github.com/duke/app</url>;

          <!--
            The username required for authorization.
            If left unspecified, the `JRELEASER_GITHUB_${name}_USERNAME`
            environment variable must be defined.
             
          -->
          <username>__DO_NOT_SET_HERE__</username>

          <!--
            Password for login into the GITHUB service.
            If left unspecified, the `JRELEASER_GITHUB_${name}_PASSWORD`
            environment variable must be defined.
             
          -->
          <password>__DO_NOT_SET_HERE__</password>

          <!--
            The authorization method to use.
            Supported values are [`NONE`, `BASIC`, `BEARER`].
            `Basic` requires both username & password.
            `BEARER` requires a token (set as password).
            Defaults to `BEARER`.
            
          -->
          <authorization>BEARER</authorization>

          <!--
            Signs artifacts with the configured credentials.
            The Signing section must be configured as well.
            Defaults to `false` unless `applyMavenCentralRules` is set to `true`.
            
          -->
          <sign>false</sign>

          <!--
            Verifies that POM files comply with the minimum requirements for publication
            to Maven Central. Checks fules using PomChecker.
            Defaults to `false` unless `applyMavenCentralRules` is set to `true`.
            
          -->
          <verifyPom>false</verifyPom>

          <!--
            Verifies pom files, signs all artifacts, verifies that matching `-sources.jar` and
            `-javadoc.jar` artifacts are also staged.
            Defaults to `false`.
            
          -->
          <applyMavenCentralRules>false</applyMavenCentralRules>

          <!--
            List of directories where staged artifacts can be found.
            
          -->
          <stagingRepositories>
            <stagingRepository>target/staging-deploy</stagingRepository>
          </stagingRepositories>

          <!--
            Defines the connection timeout in seconds.
            Defaults to `20`.
            
          -->
          <connectTimeout>20</connectTimeout>

          <!--
            Defines the read timeout in seconds.
            Defaults to `60`.
            
          -->
          <readTimeout>60</readTimeout>

          <!--
            Additional properties used when evaluating templates.
            
          -->
          <extraProperties>
            <!--
              Key will be capitalized and prefixed with `github`, i.e, `githubFoo`.
            -->
            <foo>bar</foo>
          </extraProperties>

          <!--
            The name of the repository.
            If unspecified, will use ${release.${releaser}.name}.
            
          -->
          <repository>app</repository>
        </app>
      </github>
    </maven>
  </deploy>
</jreleaser>
jreleaser {
  // 
  deploy {
    maven {
      // 
      github {
        // Deployers require a name.
        // 
        app {

          // Enables or disables the deployer.
          // Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
          // Defaults to `NEVER`.
          // 
          active = 'ALWAYS'

          // URL where the Github service is enabled.
          // If left unspecified, the `JRELEASER_GITHUB_${name}_URL`
          // environment variable must be defined.
          //  
          url = 'https://maven.pkg.github.com/duke/app'

          // The username required for authorization.
          // If left unspecified, the `JRELEASER_GITHUB_${name}_USERNAME`
          // environment variable must be defined.
          //  
          username = '__DO_NOT_SET_HERE__'

          // Password for login into the GITHUB service.
          // If left unspecified, the `JRELEASER_GITHUB_${name}_PASSWORD`
          // environment variable must be defined.
          //  
          password = '__DO_NOT_SET_HERE__'

          // The authorization method to use.
          // Supported values are [`NONE`, `BASIC`, `BEARER`].
          // `Basic` requires both username & password.
          // `BEARER` requires a token (set as password).
          // Defaults to `BEARER`.
          // 
          authorization = 'BEARER'

          // Signs artifacts with the configured credentials.
          // The Signing section must be configured as well.
          // Defaults to `false` unless `applyMavenCentralRules` is set to `true`.
          // 
          sign = false

          // Verifies that POM files comply with the minimum requirements for publication
          // to Maven Central. Checks fules using PomChecker.
          // Defaults to `false` unless `applyMavenCentralRules` is set to `true`.
          // 
          verifyPom = false

          // Verifies pom files, signs all artifacts, verifies that matching `-sources.jar` and
          // `-javadoc.jar` artifacts are also staged.
          // Defaults to `false`.
          // 
          applyMavenCentralRules = false

          // List of directories where staged artifacts can be found.
          // 
          stagingRepository('target/staging-deploy')

          // Defines the connection timeout in seconds.
          // Defaults to `20`.
          // 
          connectTimeout = 20

          // Defines the read timeout in seconds.
          // Defaults to `60`.
          // 
          readTimeout = 60

          // Additional properties used when evaluating templates.
          // Key will be capitalized and prefixed with `github`, i.e, `githubFoo`.
          // 
          extraProperties.put('foo', 'bar')

          // The name of the repository.
          // If unspecified, will use ${release.${releaser}.name}.
          // 
          repository = 'app'

        }
      }
    }
  }
}

Url

You may set the url in the configuration as shown above, or you can have it read from an environment variable. The configured name of the Github instance will be used to build the environment variable name. This means that the name per configured instance needs to be unique.

The name of the environment variable will be JRELEASER_GITHUB_NAME_URL. If your instance is named production, you can store the host in the environment variable JRELEASER_GITHUB_PRODUCTION_URL. The name will be transformed to uppercase.

Username

The configured username needs to be authenticated against the Github instance.

You may set the username set in the configuration as shown above, or you can have it read from an environment variable. The configured name of the Github instance will be used to build the environment variable name. This means that the name per configured instance needs to be unique.

The name of the environment variable will be JRELEASER_GITHUB_NAME_USERNAME. If your instance is named production, you can store the username in the environment variable JRELEASER_GITHUB_PRODUCTION_USERNAME. The name will be transformed to uppercase.

If a configured username is found in the configuration file, then the environment variable is not used at all.

Alternatives to JRELEASER_GITHUB_NAME_USERNAME are (in order):

  • JRELEASER_GITHUB_NAME_USERNAME

  • JRELEASER_GITHUB_USERNAME

Password

The password will be stored in an environment variable. The configured name of the Gitea server will be used. This means that the name per configured instance needs to be unique.

The name of the environment variable will be JRELEASER_GITHUB_NAME_PASSWORD. If your instance is named production, you need to store the secret in the environment variable JRELEASER_GITHUB_PRODUCTION_PASSWORD. The name will be transformed to uppercase.

Alternatives to JRELEASER_GITHUB_NAME_PASSWORD are (in order):

  • JRELEASER_GITHUB_NAME_PASSWORD

  • JRELEASER_GITHUB_NAME_TOKEN

  • JRELEASER_GITHUB_PASSWORD

  • JRELEASER_GITHUB_TOKEN

Example

  • YAML

  • TOML

  • JSON

  • Maven

  • Gradle

deploy:
  maven:
    github:
      app:
        active: always
        stagingRepositories:
          - target/staging-deploy
[deploy.maven.github.app]
  active = "ALWAYS"
  stagingRepositories = ["target/staging-deploy"]
{
  "jreleaser": {
    "deploy": {
      "maven": {
        "github": {
          "app": {
            "active": "ALWAYS",
            "stagingRepositories": [
              "target/staging-deploy"
            ]
          }
        }
      }
    }
  }
}
<jreleaser>
  <deploy>
    <maven>
      <github>
        <app>
          <active>ALWAYS</active>
          <stagingRepositories>target/staging-deploy</stagingRepositories>
        </app>
      </github>
    </maven>
  </deploy>
</jreleaser>
jreleaser {
  deploy {
    maven {
      github {
        app {
          active = 'ALWAYS'
          stagingRepository('target/staging-deploy')
        }
      }
    }
  }
}