Skip to content

Commit 2bdc405

Browse files
committed
merge master
2 parents 99d943c + cd7fe34 commit 2bdc405

File tree

11,562 files changed

+255117
-35313
lines changed

Some content is hidden

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

11,562 files changed

+255117
-35313
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@
1818
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example `./bin/generate-samples.sh bin/configs/java*`.
1919
IMPORTANT: Do **NOT** purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
2020
- [ ] File the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master` (upcoming `7.x.0` minor release - breaking changes with fallbacks), `8.0.x` (breaking changes without fallbacks)
21+
- [ ] If your PR solves a reported issue, reference it using [GitHub's linking syntax](https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword) (e.g., having `"fixes #123"` present in the PR description)
2122
- [ ] If your PR is targeting a particular programming language, @mention the [technical committee](https://github.com/openapitools/openapi-generator/#62---openapi-generator-technical-committee) members, so they are more likely to review the pull request.
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: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ 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'
@@ -34,12 +34,22 @@ jobs:
3434
restore-keys: |
3535
${{ runner.os }}-test-gradle-plugin-${{ env.cache-name }}-
3636
${{ runner.os }}-test-gradle-plugin-
37-
- name: Run tests
37+
- name: mvn clean install
38+
run: |
39+
./mvnw clean --no-snapshot-updates --batch-mode --quiet install -DskipTests -Dorg.slf4j.simpleLogger.defaultLogLevel=error
40+
- name: Run tests with wrapper
3841
env:
3942
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
4043
run: |
41-
./mvnw clean --no-snapshot-updates --batch-mode --quiet install -DskipTests -Dorg.slf4j.simpleLogger.defaultLogLevel=error
4244
(cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew buildGoSdk) # using gradle-6.8.3 via wrapper
4345
(cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew openApiGenerate)
4446
(cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew buildDotnetSdk)
47+
- name: Setup Gradle
48+
uses: gradle/gradle-build-action@v3
49+
with:
50+
gradle-version: '8.14.3'
51+
- name: Run tests without wrapper
52+
env:
53+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
54+
run: |
4555
(cd modules/openapi-generator-gradle-plugin/samples/local-spec && gradle buildJavaResttemplateSdk) # not using gradle wrapper

.github/workflows/gradle-test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ 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

.github/workflows/linux.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ 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 }}
@@ -44,6 +44,10 @@ jobs:
4444
restore-keys: |
4545
${{ runner.os }}-gradle-
4646
47+
- uses: gradle/actions/setup-gradle@v4
48+
with:
49+
gradle-version: '8.14.3'
50+
4751
- name: Setup Maven
4852
4953
with:
@@ -65,7 +69,7 @@ jobs:
6569

6670
- name: Test Gradle plugin usage
6771
shell: bash
68-
run: gradle -b modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle buildGoSdk --stacktrace
72+
run: gradle --project-dir modules/openapi-generator-gradle-plugin/samples/local-spec buildGoSdk --stacktrace
6973

7074
- name: Test Maven plugin integration
7175
if: matrix.java == '11'
@@ -85,14 +89,14 @@ jobs:
8589
os: [ubuntu-latest]
8690
steps:
8791
- name: Check out code
88-
uses: actions/checkout@v4
92+
uses: actions/checkout@v5
8993
- name: Setup Maven
9094
9195
with:
9296
java-version: 11
9397
maven-version: 3.8.8
9498
- name: Download build artifact
95-
uses: actions/download-artifact@v4
99+
uses: actions/download-artifact@v5
96100
with:
97101
name: artifact
98102
- 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'

.github/workflows/openapi-generator.yaml

Lines changed: 23 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ jobs:
1515
name: Build
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@v4
18+
- uses: actions/checkout@v5
1919
- name: Set up JDK 11
20-
uses: actions/setup-java@v4
20+
uses: actions/setup-java@v5
2121
with:
2222
java-version: 11
2323
distribution: 'temurin'
@@ -53,9 +53,9 @@ jobs:
5353
needs:
5454
- build
5555
steps:
56-
- uses: actions/checkout@v4
56+
- uses: actions/checkout@v5
5757
- name: Set up JDK 11
58-
uses: actions/setup-java@v4
58+
uses: actions/setup-java@v5
5959
with:
6060
java-version: 11
6161
distribution: 'temurin'
@@ -90,14 +90,14 @@ jobs:
9090
needs:
9191
- build
9292
steps:
93-
- uses: actions/checkout@v4
93+
- uses: actions/checkout@v5
9494
- name: Set up JDK 11
95-
uses: actions/setup-java@v4
95+
uses: actions/setup-java@v5
9696
with:
9797
java-version: 11
9898
distribution: 'temurin'
9999
- name: Download openapi-generator-cli.jar artifact
100-
uses: actions/download-artifact@v4
100+
uses: actions/download-artifact@v5
101101
with:
102102
name: openapi-generator-cli.jar
103103
path: modules/openapi-generator-cli/target
@@ -129,50 +129,32 @@ jobs:
129129
- build
130130
runs-on: ubuntu-latest
131131
steps:
132-
- uses: actions/checkout@v4
132+
- uses: actions/checkout@v5
133133
- name: Set up JDK 11
134-
uses: actions/setup-java@v4
134+
uses: actions/setup-java@v5
135135
with:
136136
java-version: 11
137137
distribution: 'temurin'
138138
- name: Download openapi-generator-cli.jar artifact
139-
uses: actions/download-artifact@v4
139+
uses: actions/download-artifact@v5
140140
with:
141141
name: openapi-generator-cli.jar
142142
path: modules/openapi-generator-cli/target
143143
- name: Delete samples that are entirely generated
144144
run: |
145-
rm -rf samples/client/petstore/csharp/generichost/latest/HelloWorld
146-
rm -rf samples/client/petstore/csharp/generichost/latest/Tags
147-
rm -rf samples/client/petstore/csharp/generichost/latest/OneOfList
148-
149-
rm -rf samples/client/petstore/csharp/generichost/net8/AllOf
150-
rm -rf samples/client/petstore/csharp/generichost/net8/AnyOf
151-
rm -rf samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare
152-
rm -rf samples/client/petstore/csharp/generichost/net8/FormModels
153-
rm -rf samples/client/petstore/csharp/generichost/net8/NullReferenceTypes
154-
rm -rf samples/client/petstore/csharp/generichost/net8/OneOf
155-
rm -rf samples/client/petstore/csharp/generichost/net8/Petstore
156-
rm -rf samples/client/petstore/csharp/generichost/net8/SourceGeneration
157-
rm -rf samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate
158-
159-
rm -rf samples/client/petstore/csharp/generichost/standard2.0/Petstore
160-
161-
rm -rf samples/client/petstore/csharp/generichost/net4.8/AllOf
162-
rm -rf samples/client/petstore/csharp/generichost/net4.8/AnyOf
163-
rm -rf samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare
164-
rm -rf samples/client/petstore/csharp/generichost/net4.8/FormModels
165-
rm -rf samples/client/petstore/csharp/generichost/net4.8/OneOf
166-
rm -rf samples/client/petstore/csharp/generichost/net4.8/Petstore
167-
rm -rf samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate
168-
169-
rm -rf samples/client/petstore/csharp/generichost/net4.7/AllOf
170-
rm -rf samples/client/petstore/csharp/generichost/net4.7/AnyOf
171-
rm -rf samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare
172-
rm -rf samples/client/petstore/csharp/generichost/net4.7/FormModels
173-
rm -rf samples/client/petstore/csharp/generichost/net4.7/OneOf
174-
rm -rf samples/client/petstore/csharp/generichost/net4.7/Petstore
175-
rm -rf samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate
145+
# List all directories in generichost, filter out Manual directories, and remove the rest
146+
cd samples/client/petstore/csharp/generichost
147+
for version_dir in */ ; do
148+
if [ -d "$version_dir" ]; then
149+
cd "$version_dir"
150+
for dir in */ ; do
151+
if [ -d "$dir" ] && [[ ! "$dir" =~ Manual ]]; then
152+
rm -rf "$dir"
153+
fi
154+
done
155+
cd ..
156+
fi
157+
done
176158
- name: Generate samples
177159
run: |
178160
bash bin/generate-samples.sh

0 commit comments

Comments
 (0)