Skip to content

Commit 05d61f7

Browse files
committed
feat: Changing to a config based approach for obtaining the official openapi generator jar.
chore: updated release workflows chore: updated release workflows chore: updated release workflows chore: updated release workflows chore: updated release workflows chore: updated release workflows chore: updated melos config chore: updated melos config chore: moved things around chore: moved things around chore: moved things around chore: fixed failing build chore: fixed failing build
1 parent 2ff3b99 commit 05d61f7

Some content is hidden

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

43 files changed

+1320
-260
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!--
2+
Thanks for contributing!
3+
4+
Provide a description of your changes below and a general summary in the title
5+
6+
Please look at the following checklist to ensure that your PR can be accepted quickly:
7+
-->
8+
9+
## Description
10+
11+
<!--- Describe your changes in detail -->
12+
13+
## Type of Change
14+
15+
<!--- Put an `x` in all the boxes that apply: -->
16+
17+
- [ ]`feat` -- New feature (non-breaking change which adds functionality)
18+
- [ ] 🛠️ `fix` -- Bug fix (non-breaking change which fixes an issue)
19+
- [ ]`!` -- Breaking change (fix or feature that would cause existing functionality to change)
20+
- [ ] 🧹 `refactor` -- Code refactor
21+
- [ ]`ci` -- Build configuration change
22+
- [ ] 📝 `docs` -- Documentation
23+
- [ ] 🗑️ `chore` -- Chore

.github/labeler.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ docs:
1010
- 'README.md'
1111
- 'CHANGELOG.md'
1212
- 'LICENSE'
13+
workspace:
14+
- 'melos.yaml'
15+
- 'pubspec.yaml'
16+
- 'release-please-config.json'

.github/workflows/code_quality.yml

Lines changed: 53 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,48 +15,75 @@ jobs:
1515
ci:
1616
name: Dart CI Checks
1717
runs-on: ubuntu-latest
18-
strategy:
19-
fail-fast: false
20-
matrix:
21-
work_dir: [ openapi-generator, openapi-generator-annotations ]
22-
defaults:
23-
run:
24-
working-directory: ${{ matrix.work_dir }}
18+
# strategy:
19+
# fail-fast: false
20+
# matrix:
21+
# work_dir: [ openapi-generator, openapi-generator-annotations ]
22+
# defaults:
23+
# run:
24+
# working-directory: ${{ matrix.work_dir }}
2525
steps:
2626
- name: Checkout
2727
uses: actions/checkout@v3
28-
- name: Start Docker compose containers
29-
if: ${{ matrix.work_dir == 'openapi-generator' }}
30-
run: docker-compose -f "docker-compose.yaml" up -d --build
28+
# - name: Start Docker compose containers
29+
# if: ${{ matrix.work_dir == 'openapi-generator' }}
30+
# run: docker-compose -f "docker-compose.yaml" up -d --build
3131
- name: Setup Dart
3232
uses: dart-lang/setup-dart@v1.5.0
3333
with:
3434
sdk: stable
35+
- name: Install Melos
36+
run: dart pub global activate melos
37+
- name: Bootstrap Melos
38+
run: melos bootstrap
3539
- name: Install Dependencies
36-
run: dart pub get
40+
run: melos exec -- "dart pub get"
41+
- name: Run Docker Compose on Specific Package
42+
run: |
43+
melos exec -p openapi-generator -- docker-compose -f "docker-compose.yaml" up -d --build
3744
- name: Build runner
38-
if: ${{ matrix.work_dir == 'openapi-generator' }}
39-
run: dart run build_runner build --delete-conflicting-outputs
45+
run: melos exec -p openapi-generator dart run build_runner build --delete-conflicting-outputs
4046
- name: Validate formatting
41-
run: dart format ./ --set-exit-if-changed
47+
run: melos format --set-exit-if-changed
4248
- name: Run analyzer
43-
run: dart analyze --fatal-warnings
49+
run: melos analyze --fatal-warnings
4450
- name: Run tests
45-
run: dart run test --coverage="coverage"
51+
run: melos run test:all
52+
4653
- name: Install coverage tools
4754
run: dart pub global activate coverage
48-
- name: format coverage
49-
run: $HOME/.pub-cache/bin/format_coverage --lcov --in=coverage --out=./coverage.lcov --package=. --report-on=lib
50-
- name: Upload coverage reports to Codecov
55+
56+
- name: Install Coverage Tools
57+
run: dart pub global activate coverage combine_coverage
58+
59+
- name: Format Coverage for Each Package
60+
run: |
61+
# Find each package's coverage directory and format to lcov
62+
for dir in $(find . -name "coverage" -type d); do
63+
$HOME/.pub-cache/bin/format_coverage \
64+
--lcov \
65+
--in=$dir \
66+
--out=$dir/coverage.lcov \
67+
--packages=$dir/../.packages \
68+
--report-on=lib
69+
done
70+
71+
- name: Combine Coverage Reports
72+
run: |
73+
mkdir -p coverage # Create a root coverage folder if it doesn't exist
74+
dart pub global run combine_coverage \
75+
--repo-path="." \
76+
--output=coverage/combined.lcov # Combines all into a single lcov file
77+
78+
- name: Upload Combined Coverage to Codecov
5179
uses: codecov/codecov-action@v3
80+
with:
81+
files: ./coverage/combined.lcov
82+
flags: combined_coverage
83+
name: Combined Code Coverage
84+
fail_ci_if_error: true
5285
env:
53-
files: ./coverage.lcov
54-
verbose: true
55-
flags: ${{ matrix.work_dir }}
56-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
57-
- name: Stop Docker Container
58-
if: ${{ matrix.work_dir == 'openapi-generator' && always() }}
59-
run: docker-compose -f "docker-compose.yaml" down
86+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} # Required only for private repositories
6087

6188
build:
6289
name: Build example project 🛠️

.github/workflows/pr_title.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: 'PR Title is Conventional'
2+
on:
3+
pull_request_target:
4+
types:
5+
- opened
6+
- edited
7+
- synchronize
8+
9+
jobs:
10+
main:
11+
name: Validate PR title
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: amannn/action-semantic-pull-request@v4.5.0
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 20 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -10,45 +10,27 @@ on:
1010
jobs:
1111
test:
1212
uses: gibahjoe/openapi-generator-dart/.github/workflows/code_quality.yml@master
13-
publish-cli:
13+
publish:
14+
name: Publish Packages with Melos
1415
runs-on: ubuntu-latest
1516
needs: [test]
1617
steps:
1718
- name: Checkout
18-
uses: actions/checkout@v1
19-
- name: Publish
20-
uses: sakebook/actions-flutter-pub-publisher@v1.3.1
21-
with:
22-
credential: ${{ secrets.PUB_CREDENTIAL_JSON }}
23-
package_directory: ./openapi-generator-cli
24-
flutter_package: true
25-
skip_test: true
26-
dry_run: false
27-
publish-annotation:
28-
runs-on: ubuntu-latest
29-
needs: [test]
30-
steps:
31-
- name: Checkout
32-
uses: actions/checkout@v1
33-
- name: Publish
34-
uses: sakebook/actions-flutter-pub-publisher@v1.3.1
35-
with:
36-
credential: ${{ secrets.PUB_CREDENTIAL_JSON }}
37-
package_directory: ./openapi-generator-annotations
38-
flutter_package: true
39-
skip_test: true
40-
dry_run: false
41-
publish-generator:
42-
runs-on: ubuntu-latest
43-
needs: [publish-annotation, publish-cli]
44-
steps:
45-
- name: Checkout
46-
uses: actions/checkout@v1
47-
- name: Publish
48-
uses: sakebook/actions-flutter-pub-publisher@v1.3.1
49-
with:
50-
credential: ${{ secrets.PUB_CREDENTIAL_JSON }}
51-
package_directory: ./openapi-generator
52-
flutter_package: true
53-
skip_test: false
54-
dry_run: false
19+
uses: actions/checkout@v3
20+
21+
- name: Setup Dart
22+
uses: dart-lang/setup-dart@v1
23+
24+
- name: Install Melos
25+
run: dart pub global activate melos
26+
27+
- name: Authenticate with Pub
28+
run: echo "${{ secrets.PUB_CREDENTIAL_JSON }}" > ~/.pub-cache/credentials.json
29+
30+
- name: Bootstrap Melos
31+
run: melos bootstrap
32+
33+
- name: Version and Publish
34+
run: |
35+
melos version --yes
36+
melos publish --no-dry-run --yes

.github/workflows/release_please.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,16 @@ permissions:
1010

1111
jobs:
1212
release-please:
13+
if: >
14+
github.event_name == 'push' ||
15+
(github.event_name == 'pull_request' && github.event.pull_request.merged == true && !startsWith(github.event.pull_request.title, 'chore(release):'))
1316
runs-on: ubuntu-latest
1417
steps:
1518
- uses: google-github-actions/release-please-action@v3
1619
with:
1720
command: manifest
1821
token: ${{ secrets.OG_BOT_TOKEN }}
22+
release-type: dart
23+
bump-minor-pre-major: false
24+
bump-patch-for-minor-pre-major: false
25+
version-file: "changelog-only"

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ doc/api/
1616
.DS_Store
1717

1818
**/coverage
19+
20+
pubspec_overrides.yaml
21+
!pubspec.lock

.release-please-manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"openapi-generator": "5.0.2",
3-
"openapi-generator-annotations": "5.0.2",
4-
"openapi-generator-cli": "5.0.2"
2+
"openapi-generator": "5.0.3",
3+
"openapi-generator-annotations": "5.0.3",
4+
"openapi-generator-cli": "5.0.3"
55
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ Check out the known issues article here [Known Issues](openapi-generator-annotat
140140

141141
## Contributing
142142

143-
All contributions are welcome. Please ensure to read through our [contributing guidelines](Contributing.md) before
143+
All contributions are welcome. Please ensure to read through our [contributing guidelines](CONTRIBUTING.md) before
144144
sending your PRs.
145145

146146
## Features and bugs

example/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ android {
4444
defaultConfig {
4545
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
4646
applicationId "com.example.example"
47-
minSdkVersion 16
47+
minSdkVersion flutter.minSdkVersion
4848
targetSdkVersion 30
4949
versionCode flutterVersionCode.toInteger()
5050
versionName flutterVersionName

0 commit comments

Comments
 (0)