Skip to content

Commit 1418e7d

Browse files
krumbs8749darw-soptim
authored andcommitted
merged with upstream
2 parents 4b372e2 + fd72d4d commit 1418e7d

File tree

14,116 files changed

+441218
-74736
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

14,116 files changed

+441218
-74736
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!--
22
Please follow the issue template below for bug reports and feature requests.
3-
Also please indicate in the issue title which language/library is concerned. Eg: [JAVA] Bug generating foo with bar
3+
Also please indicate in the issue title which language/library is concerned. E.g.: [JAVA] Bug generating foo with bar
44
-->
55

66
##### Description

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ assignees: ''
1818

1919
<!--
2020
Please follow the issue template below for bug reports.
21-
Also please indicate in the issue title which language/library is concerned. Eg: [BUG][JAVA] Bug generating foo with bar
21+
Also please indicate in the issue title which language/library is concerned. E.g.: [BUG][JAVA] Bug generating foo with bar
2222
-->
2323

2424
##### Description
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Release to DockerHub (snapshot, stable)
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Triggers on any tag starting with 'v' (e.g., v1.0, v2.1.3)
7+
branches:
8+
- master
9+
jobs:
10+
docker:
11+
name: Publish images
12+
runs-on: ubuntu-latest
13+
steps:
14+
# build the JARs
15+
- uses: actions/checkout@v5
16+
with:
17+
fetch-depth: 0
18+
- name: Set up JDK 11
19+
uses: actions/setup-java@v5
20+
with:
21+
java-version: 11
22+
distribution: 'zulu'
23+
- name: Cache Maven packages
24+
uses: actions/cache@v4
25+
with:
26+
path: ~/.m2
27+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
28+
restore-keys: ${{ runner.os }}-m2
29+
- name: Build
30+
run: ./mvnw clean install -DskipTests=true
31+
32+
# docker workflow
33+
- name: Set up QEMU
34+
uses: docker/setup-qemu-action@v3
35+
- name: Set up Docker Buildx
36+
uses: docker/setup-buildx-action@v3
37+
- name: Login to DockerHub
38+
uses: docker/login-action@v3
39+
with:
40+
username: ${{ secrets.DOCKER_USERNAME }}
41+
password: ${{ secrets.DOCKER_PASSWORD }}
42+
- name: Setup variables
43+
run: |
44+
# set as GitHub ENV variables
45+
echo "cli_version=$(\./mvnw -o org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -v '\[')" >> $GITHUB_ENV
46+
echo "build_date=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_ENV
47+
echo "DOCKER_GENERATOR_IMAGE_NAME=openapitools/openapi-generator-online" >> $GITHUB_ENV
48+
echo "DOCKER_CODEGEN_CLI_IMAGE_NAME=openapitools/openapi-generator-cli" >> $GITHUB_ENV
49+
50+
# online images
51+
- name: Publish openapi-generator-online snapshot version
52+
if: github.ref_type != 'tag' # not tag (release)
53+
run: |
54+
docker buildx create --use
55+
docker buildx build --push --platform linux/amd64,linux/arm64 --label=org.opencontainers.image.created=${{ env.build_date }} --label=org.opencontainers.image.title=openapi-generator-online --label=org.opencontainers.image.revision=$GITHUB_SHA --label=org.opencontainers.image.version=${{ env.cli_version }} -t ${{ env.DOCKER_GENERATOR_IMAGE_NAME }} ./modules/openapi-generator-online
56+
- name: Publish openapi-generator-online stable version
57+
if: github.ref_type == 'tag' # tagged (release)
58+
run: |
59+
docker buildx create --use
60+
docker buildx build --push --platform linux/amd64,linux/arm64 --label=org.opencontainers.image.created=${{ env.build_date }} --label=org.opencontainers.image.title=openapi-generator-online --label=org.opencontainers.image.revision=$GITHUB_SHA --label=org.opencontainers.image.version=${{ env.cli_version }} -t ${{ env.DOCKER_GENERATOR_IMAGE_NAME }}:latest -t ${{ env.DOCKER_GENERATOR_IMAGE_NAME }}:${{ github.ref_name }} -t ${{ env.DOCKER_GENERATOR_IMAGE_NAME }} -t ${{ env.DOCKER_GENERATOR_IMAGE_NAME }}:latest-release ./modules/openapi-generator-online
61+
62+
# cli images
63+
- name: Publish openapi-generator-cli snapshot version
64+
if: github.ref_type != 'tag' # not tag (release)
65+
run: |
66+
cp docker-entrypoint.sh ./modules/openapi-generator-cli
67+
docker buildx create --use
68+
docker buildx build --push --platform linux/amd64,linux/arm64 --label=org.opencontainers.image.created=${{ env.build_date }} --label=org.opencontainers.image.title=openapi-generator-cli --label=org.opencontainers.image.revision=$GITHUB_SHA --label=org.opencontainers.image.version=${{ env.cli_version }} -t ${{ env.DOCKER_CODEGEN_CLI_IMAGE_NAME }} ./modules/openapi-generator-cli
69+
- name: Publish openapi-generator-cli stable version
70+
if: github.ref_type == 'tag' # tagged (release)
71+
run: |
72+
cp docker-entrypoint.sh ./modules/openapi-generator-cli
73+
docker buildx create --use
74+
docker buildx build --push --platform linux/amd64,linux/arm64 --label=org.opencontainers.image.created=${{ env.build_date }} --label=org.opencontainers.image.title=openapi-generator-cli --label=org.opencontainers.image.revision=$GITHUB_SHA --label=org.opencontainers.image.version=${{ env.cli_version }} -t ${{ env.DOCKER_CODEGEN_CLI_IMAGE_NAME }}:latest -t ${{ env.DOCKER_CODEGEN_CLI_IMAGE_NAME }}:${{ github.ref_name }} -t ${{ env.DOCKER_CODEGEN_CLI_IMAGE_NAME }} -t ${{ env.DOCKER_CODEGEN_CLI_IMAGE_NAME }}:latest-release ./modules/openapi-generator-cli

.github/workflows/docker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
runs-on: ubuntu-latest
2727
steps:
2828
- name: Check out code
29-
uses: actions/checkout@v4
29+
uses: actions/checkout@v5
3030

3131
- name: Test run-in-docker.sh
3232
shell: bash

.github/workflows/gradle-plugin-tests.yaml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ jobs:
1313
name: Gradle plugin tests
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v5
1717
- name: Set up JDK 11
18-
uses: actions/setup-java@v4
18+
uses: actions/setup-java@v5
1919
with:
2020
java-version: 11
2121
distribution: 'temurin'
22+
cache: gradle
2223
- name: Cache maven dependencies
2324
uses: actions/cache@v4
2425
env:
@@ -34,12 +35,22 @@ jobs:
3435
restore-keys: |
3536
${{ runner.os }}-test-gradle-plugin-${{ env.cache-name }}-
3637
${{ runner.os }}-test-gradle-plugin-
37-
- name: Run tests
38+
- name: mvn clean install
39+
run: |
40+
./mvnw clean --no-snapshot-updates --batch-mode --quiet install -DskipTests -Dorg.slf4j.simpleLogger.defaultLogLevel=error
41+
- name: Run tests with wrapper
3842
env:
3943
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
4044
run: |
41-
./mvnw clean --no-snapshot-updates --batch-mode --quiet install -DskipTests -Dorg.slf4j.simpleLogger.defaultLogLevel=error
4245
(cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew buildGoSdk) # using gradle-6.8.3 via wrapper
4346
(cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew openApiGenerate)
4447
(cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew buildDotnetSdk)
48+
- name: Setup Gradle
49+
uses: gradle/gradle-build-action@v3
50+
with:
51+
gradle-version: '8.14.3'
52+
- name: Run tests without wrapper
53+
env:
54+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
55+
run: |
4556
(cd modules/openapi-generator-gradle-plugin/samples/local-spec && gradle buildJavaResttemplateSdk) # not using gradle wrapper

.github/workflows/gradle-test.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ jobs:
3232
- samples/client/petstore/java/native
3333
- samples/client/petstore/java/native-jakarta
3434
steps:
35-
- uses: actions/checkout@v4
36-
- uses: actions/setup-java@v4
35+
- uses: actions/checkout@v5
36+
- uses: actions/setup-java@v5
3737
with:
3838
distribution: 'temurin'
3939
java-version: 11
40+
cache: gradle
4041
# Cache Gradle Dependencies
4142
- name: Setup Gradle Dependencies Cache
4243
uses: actions/cache@v4

.github/workflows/linux.yaml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ jobs:
2020
os: [ubuntu-latest]
2121
steps:
2222
- name: Check out code
23-
uses: actions/checkout@v4
23+
uses: actions/checkout@v5
2424

2525
- name: Set up JDK ${{ matrix.java }}
26-
uses: actions/setup-java@v4
26+
uses: actions/setup-java@v5
2727
with:
2828
distribution: 'temurin'
2929
java-version: ${{ matrix.java }}
30+
cache: gradle
3031

3132
- uses: actions/cache@v4
3233
with:
@@ -44,8 +45,12 @@ jobs:
4445
restore-keys: |
4546
${{ runner.os }}-gradle-
4647
48+
- uses: gradle/actions/setup-gradle@v5
49+
with:
50+
gradle-version: '8.14.3'
51+
4752
- name: Setup Maven
48-
uses: s4u/setup-maven-action@v1.18.0
53+
uses: s4u/setup-maven-action@v1.19.0
4954
with:
5055
java-version: ${{ matrix.java }}
5156
maven-version: 3.8.8
@@ -57,15 +62,15 @@ jobs:
5762
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
5863

5964
- name: Upload Maven build artifact
60-
uses: actions/upload-artifact@v4
65+
uses: actions/upload-artifact@v5
6166
if: matrix.java == '11' && matrix.os == 'ubuntu-latest'
6267
with:
6368
name: artifact
6469
path: modules/openapi-generator-cli/target/openapi-generator-cli.jar
6570

6671
- name: Test Gradle plugin usage
6772
shell: bash
68-
run: gradle -b modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle buildGoSdk --stacktrace
73+
run: gradle --project-dir modules/openapi-generator-gradle-plugin/samples/local-spec buildGoSdk --stacktrace
6974

7075
- name: Test Maven plugin integration
7176
if: matrix.java == '11'
@@ -85,14 +90,15 @@ jobs:
8590
os: [ubuntu-latest]
8691
steps:
8792
- name: Check out code
88-
uses: actions/checkout@v4
93+
uses: actions/checkout@v5
8994
- name: Setup Maven
90-
uses: s4u/setup-maven-action@v1.18.0
95+
uses: s4u/setup-maven-action@v1.19.0
9196
with:
9297
java-version: 11
9398
maven-version: 3.8.8
99+
cache: gradle
94100
- name: Download build artifact
95-
uses: actions/download-artifact@v4
101+
uses: actions/download-artifact@v6
96102
with:
97103
name: artifact
98104
- name: Run Ensures Script

.github/workflows/maven-plugin-tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ jobs:
1313
name: Maven plugin tests
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v5
1717
- name: Set up JDK 11
18-
uses: actions/setup-java@v4
18+
uses: actions/setup-java@v5
1919
with:
2020
java-version: 11
2121
distribution: 'temurin'
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Release to Maven Central (snapshot, stable)
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
jobs:
8+
build:
9+
name: Build
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v5
13+
with:
14+
fetch-depth: 0
15+
- name: Set up JDK 11
16+
uses: actions/setup-java@v5
17+
with:
18+
java-version: 11
19+
distribution: 'zulu'
20+
- name: Cache Maven packages
21+
uses: actions/cache@v4
22+
with:
23+
path: ~/.m2
24+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
25+
restore-keys: ${{ runner.os }}-m2
26+
- name: Build
27+
run: ./mvnw clean install -DskipTests=true
28+
#run: ./mvnw clean install
29+
30+
publish:
31+
runs-on: ubuntu-latest
32+
name: Publish to Maven Central
33+
needs: build
34+
permissions:
35+
contents: read
36+
packages: write
37+
steps:
38+
- uses: actions/checkout@v5
39+
with:
40+
fetch-depth: 0
41+
42+
- id: install-secret-key
43+
name: Install gpg secret key
44+
run: |
45+
cat <(echo -e "${{ secrets.GPG_PRIVATE_KEY }}") | gpg --batch --import
46+
gpg --list-secret-keys --keyid-format LONG
47+
48+
- name: Set up Maven Central Repository
49+
uses: actions/setup-java@v5
50+
with:
51+
java-version: 11
52+
distribution: 'zulu'
53+
server-id: central
54+
server-username: MAVEN_USERNAME
55+
server-password: MAVEN_PASSWORD
56+
57+
- name: Publish package
58+
run: ./mvnw -DskipTests=true --batch-mode -P release -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} deploy
59+
env:
60+
MAVEN_USERNAME: ${{ secrets.OSS_USERNAME }}
61+
MAVEN_PASSWORD: ${{ secrets.OSS_PASSWORD }}

.github/workflows/misc-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
name: Misc tests
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@v4
18+
- uses: actions/checkout@v5
1919
- uses: ruby/setup-ruby@v1
2020
with:
2121
ruby-version: '2.6'

0 commit comments

Comments
 (0)