Skip to content

Commit

Permalink
Merge branch 'main' into add-support-for-multiline-review-comments
Browse files Browse the repository at this point in the history
  • Loading branch information
maximevw committed Apr 19, 2024
2 parents b5f5551 + 6b2a487 commit 199227c
Show file tree
Hide file tree
Showing 136 changed files with 9,363 additions and 1,638 deletions.
@@ -1,4 +1,4 @@
name: Creat New Release Tag
name: Create New Release Tag and PR

on: workflow_dispatch

Expand All @@ -11,13 +11,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Maven Central Repository
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'

- name: Reset staging/main
id: staging
run: |
git checkout -B staging/main
git push --set-upstream -f origin staging/main
- name: Set Release Version
id: release
run: |
Expand All @@ -29,7 +38,7 @@ jobs:
commit_message: "Prepare release (${{ github.actor }}): github-api-${{ steps.release.outputs.version }}"
tagging_message: 'github-api-${{ steps.release.outputs.version }}'
branch: staging/main

- name: Increment Snapshot Version
run: |
mvn versions:set versions:commit -DnextSnapshot
Expand All @@ -38,7 +47,7 @@ jobs:
with:
commit_message: "Prepare for next development iteration"
branch: staging/main

- name: pull-request to main
uses: repo-sync/pull-request@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/maven-build.yml
Expand Up @@ -86,7 +86,7 @@ jobs:
run: mvn -B clean install -D enable-ci --file pom.xml "-Dsurefire.argLine=--add-opens java.base/java.net=ALL-UNNAMED"
- name: Codecov Report
if: matrix.os == 'ubuntu' && matrix.java == '17'
uses: codecov/codecov-action@v4.1.0
uses: codecov/codecov-action@v4.1.1

test-java-8:
name: test Java 8 (no-build)
Expand Down
61 changes: 53 additions & 8 deletions .github/workflows/publish_release_branch.yml
Expand Up @@ -9,7 +9,7 @@ env:
JAVA_11_PLUS_MAVEN_OPTS: "--add-opens jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED"

jobs:
publish:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -19,26 +19,71 @@ jobs:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
server-id: sonatype-nexus-staging
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Maven Install and Site with Code Coverage
env:
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
run: mvn -B clean install site -D enable-ci --file pom.xml "-Dsurefire.argLine=--add-opens java.base/java.net=ALL-UNNAMED"

- uses: actions/upload-artifact@v4
with:
name: maven-target-directory
name: maven-release-target-directory
path: target/
retention-days: 3


publish_package:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Set up Maven Central Repository
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
server-id: sonatype-nexus-staging
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Publish package
run: mvn -B clean deploy -DskipTests -Prelease
env:
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
MAVEN_USERNAME: ${{ secrets.OSSRH_TOKEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSPHRASE }}

publish_gh_pages:
runs-on: ubuntu-latest
needs: build
if: ${{ github.ref == 'refs/heads/release/v1.x' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set Release Version
id: release
run: |
echo "version=$(mvn -B help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
- uses: actions/download-artifact@v4
with:
name: maven-release-target-directory
path: target

- name: Checkout GH Pages
run: |
git checkout -B gh-pages origin/gh-pages
find . -type f -and -not -path './target/*' -and -not -path './.*' -and -not -name CNAME -delete
cp -r ./target/site/* ./
- name: Publish GH Pages
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Release (${{ github.actor }}): v${{ steps.release.outputs.version }}"
branch: gh-pages

6 changes: 3 additions & 3 deletions pom.xml
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.kohsuke</groupId>
<artifactId>github-api</artifactId>
<version>1.320-SNAPSHOT</version>
<version>1.322-SNAPSHOT</version>
<name>GitHub API for Java</name>
<url>https://github-api.kohsuke.org/</url>
<description>GitHub API for Java</description>
Expand Down Expand Up @@ -223,7 +223,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.4.1</version>
<version>3.6.3</version>
<configuration>
<release>8</release>
<failOnWarnings>true</failOnWarnings>
Expand Down Expand Up @@ -526,7 +526,7 @@
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>4.2.0</version>
<version>4.2.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/org/kohsuke/github/GHCreateRepositoryBuilder.java
@@ -1,6 +1,7 @@
package org.kohsuke.github;

import java.io.IOException;
import java.util.Objects;

import static org.kohsuke.github.internal.Previews.BAPTISTE;

Expand Down Expand Up @@ -131,6 +132,23 @@ public GHCreateRepositoryBuilder fromTemplateRepository(String templateOwner, St
return this;
}

/**
* Create repository from template repository.
*
* @param templateRepository
* the template repository as a GHRepository
* @return a builder to continue with building
* @see <a href="https://developer.github.com/v3/previews/">GitHub API Previews</a>
*/
@Preview(BAPTISTE)
public GHCreateRepositoryBuilder fromTemplateRepository(GHRepository templateRepository) {
Objects.requireNonNull(templateRepository, "templateRepository cannot be null");
if (!templateRepository.isTemplate()) {
throw new IllegalArgumentException("The provided repository is not a template repository.");
}
return fromTemplateRepository(templateRepository.getOwnerName(), templateRepository.getName());
}

/**
* Creates a repository with all the parameters.
*
Expand Down

0 comments on commit 199227c

Please sign in to comment.