Skip to content

Commit

Permalink
Merge branch 'main' into ghe-pre-receive-hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
bitwiseman committed Apr 27, 2024
2 parents 77e71e3 + 6b2a487 commit 835a1be
Show file tree
Hide file tree
Showing 7,332 changed files with 252,191 additions and 113,171 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
5 changes: 3 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
# Before submitting a PR:

- [ ] Changes must not break binary backwards compatibility. If you are unclear on how to make the change you think is needed while maintaining backward compatibility, [CONTRIBUTING.md](CONTRIBUTING.md) for details.
- [ ] Add JavaDocs and other comments as appropriate. Consider including links in comments to relevant documentation on https://docs.github.com/en/rest .
- [ ] Add JavaDocs and other comments explaining the behavior.
- [ ] When adding or updating methods that fetch entities, add `@link` JavaDoc entries to the relevant documentation on https://docs.github.com/en/rest .
- [ ] Add tests that cover any added or changed code. This generally requires capturing snapshot test data. See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
- [ ] Run `mvn -D enable-ci clean install site` locally. If this command doesn't succeed, your change will not pass CI.
- [ ] Push your changes to a branch other than `main`. You will create your PR from that branch.
Expand All @@ -14,6 +15,6 @@

- [ ] Fill in the "Description" above with clear summary of the changes. This includes:
- [ ] If this PR fixes one or more issues, include "Fixes #<issue number>" lines for each issue.
- [ ] Provide links to relevant documentation on https://docs.github.com/en/rest where possible.
- [ ] Provide links to relevant documentation on https://docs.github.com/en/rest where possible. If not including links, explain why not.
- [ ] All lines of new code should be covered by tests as reported by code coverage. Any lines that are not covered must have PR comments explaining why they cannot be covered. For example, "Reaching this particular exception is hard and is not a particular common scenario."
- [ ] Enable "Allow edits from maintainers".
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -57,7 +57,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -71,4 +71,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
57 changes: 57 additions & 0 deletions .github/workflows/create_release_tag_and_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Create New Release Tag and PR

on: workflow_dispatch

permissions:
contents: write
pull-requests: write

jobs:
create_release_tag:
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: |
mvn -B versions:set versions:commit -DremoveSnapshot
echo "version=$(mvn -B help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
- uses: stefanzweifel/git-auto-commit-action@v5
with:
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
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Prepare for next development iteration"
branch: staging/main

- name: pull-request to main
uses: repo-sync/pull-request@v2
with:
pr_title: "Prepare release (${{ github.actor }}): github-api-${{ steps.release.outputs.version }}"
source_branch: "staging/main"
destination_branch: "main"
github_token: ${{ secrets.GITHUB_TOKEN }}
100 changes: 51 additions & 49 deletions .github/workflows/maven-build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: CI

on:
on:
push:
branches:
- main
Expand All @@ -19,64 +19,44 @@ permissions:

jobs:
build:
name: build-only (Java ${{ matrix.java }})
name: build-only (Java 17)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java: [ 17 ]
fail-fast: true
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: 'maven'
- name: Maven Install (skipTests)
env:
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
run: mvn -B clean install -DskipTests --file pom.xml
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
cache: 'maven'
- name: Maven Install (skipTests)
env:
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
run: mvn -B clean install -DskipTests --file pom.xml
- uses: actions/upload-artifact@v4
with:
name: maven-target-directory
path: target/
retention-days: 3
site:
name: site (Java ${{ matrix.java }})
name: site (Java 17)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java: [ 17 ]
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: 'maven'
- name: Maven Site
env:
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
run: mvn -B clean site -D enable-ci --file pom.xml
test-8:
name: test (${{ matrix.os }}, Java 8)
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os: [ ubuntu ]
java: [ 8 ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
java-version: 17
distribution: 'temurin'
cache: 'maven'
# JDK 8
- name: Maven Install with Code Coverage
run: mvn -B clean install -D enable-ci -Djapicmp.skip --file pom.xml
- name: Codecov Report
uses: codecov/codecov-action@v3.1.1
- name: Maven Site
env:
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
run: mvn -B clean site -D enable-ci --file pom.xml
test:
name: test (${{ matrix.os }}, Java ${{ matrix.java }})
runs-on: ${{ matrix.os }}-latest
Expand All @@ -86,9 +66,9 @@ jobs:
os: [ ubuntu, windows ]
java: [ 11, 17 ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
Expand All @@ -104,3 +84,25 @@ jobs:
env:
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
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.1

test-java-8:
name: test Java 8 (no-build)
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: maven-target-directory
path: target
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 8
distribution: 'temurin'
cache: 'maven'
- name: Maven Test (no build) Java 8
run: mvn -B surefire:test -DfailIfNoTests -Dsurefire.excludesFile=src/test/resources/slow-or-flaky-tests.txt
89 changes: 89 additions & 0 deletions .github/workflows/publish_release_branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Publish package to the Maven Central Repository
on:
push:
branches:
- release/*

# this is required by spotless for JDK 16+
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:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Maven Central Repository
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'

- 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-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

2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Release Drafter
uses: release-drafter/release-drafter@v5
uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ a Java VM option). For example:
The above command will create snapshot WireMock data files under the path `src/test/resources/org/kohsuhke/github/YourTestClassName/wiremock`.
Each method will get a separate directory that will hold the data files for that test method.

*Note:* if you are using personal github account don't forget to change `getTempRepository()` to `gitHub.getRepository("${your_account}/${test_method_name}")`
in order to match with snapshot file name for wiremock. To double-check run test without `-Dtest.github.org=false` flag after snapshot is saved.

Add all files including the generated data to your commit and submit a PR.

### Modifying existing tests
Expand Down
Loading

0 comments on commit 835a1be

Please sign in to comment.