Skip to content

Commit 9d84d69

Browse files
committed
added github actions
1 parent 0dae2ef commit 9d84d69

File tree

22 files changed

+441
-12
lines changed

22 files changed

+441
-12
lines changed
+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Bug Report
2+
description: You have noticed a general issue or regression, and would like to report it
3+
labels: [bug]
4+
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thank you for taking the time to fill out this bug report!
10+
Please note that contributor time is limited, and we might not get back to you immediately.
11+
Also make sure to check if [an existing issue](https://github.com/gibahjoe/openapi-generator-dart/issues) matches yours.
12+
- type: textarea
13+
attributes:
14+
label: Description of the bug
15+
description: Provide a clear and concise description of the bug.
16+
validations:
17+
required: true
18+
- type: textarea
19+
attributes:
20+
label: Steps to reproduce
21+
description: Explain how a maintainer can reliably reproduce the bug.
22+
validations:
23+
required: true
24+
- type: textarea
25+
attributes:
26+
label: Expected behavior
27+
description: Provide a clear and concise description of what you expected to happen.
28+
validations:
29+
required: true
30+
- type: textarea
31+
attributes:
32+
label: Logs
33+
description: If relevant, provide **browser** logs indicating an error.
34+
render: text
35+
- type: textarea
36+
attributes:
37+
label: Screenshots
38+
description: If applicable, add screenshots to help explain your problem.
39+
- type: dropdown
40+
attributes:
41+
label: Platform
42+
options:
43+
- Linux
44+
- Windows
45+
- macOS
46+
- Android
47+
- iOS
48+
validations:
49+
required: true
50+
- type: input
51+
attributes:
52+
label: Library version
53+
placeholder: "10.7.6"
54+
validations:
55+
required: true
56+
- type: input
57+
attributes:
58+
label: Flutter version
59+
placeholder: "3.3"
60+
validations:
61+
required: true
62+
- type: input
63+
attributes:
64+
label: Flutter channel
65+
placeholder: stable
66+
validations:
67+
required: true
68+
- type: textarea
69+
attributes:
70+
label: Additional context
71+
description: If necessary, provide any further context or information.
72+
render: text

.github/ISSUE_TEMPLATE/config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: false

.github/labeler.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
github_actions:
2+
- '.github/workflows/*'
3+
generator:
4+
- 'openapi-generator/*'
5+
annotations:
6+
- 'openapi-generator-annotations/*'
7+
cli:
8+
- 'openapi-generator-cli/*'

.github/workflows/automation.yml

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Automation 🤖
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
5+
cancel-in-progress: true
6+
7+
on:
8+
push:
9+
branches:
10+
- master
11+
paths-ignore:
12+
- '**/*.md'
13+
pull_request_target:
14+
15+
jobs:
16+
compose-comment:
17+
name: Compose PR comment
18+
if: ${{ always() && !cancelled() && github.event_name == 'pull_request_target' }}
19+
uses: ./.github/workflows/job_messages.yml
20+
with:
21+
commit: ${{ github.event.pull_request.head.sha }}
22+
commenting_workflow_run_id: ${{ github.run_id }}
23+
in_progress: true
24+
25+
push-comment:
26+
name: Push comment to PR 🖥️
27+
if: |
28+
always() &&
29+
!cancelled() &&
30+
github.event_name == 'pull_request_target' &&
31+
needs.compose-comment.result == 'success'
32+
runs-on: ubuntu-latest
33+
needs:
34+
- compose-comment
35+
36+
steps:
37+
- name: Create comment
38+
uses: thollander/[email protected]
39+
with:
40+
GITHUB_TOKEN: ${{ secrets.OG_BOT_TOKEN }}
41+
message: ${{ needs.compose-comment.outputs.msg }}
42+
comment_tag: ${{ needs.compose-comment.outputs.marker }}
43+
mode: recreate
44+
45+
project:
46+
name: Project board 📊
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: alex-page/[email protected]
50+
if: ${{ github.event_name == 'pull_request_target' }}
51+
continue-on-error: true
52+
with:
53+
project: Ongoing development
54+
column: In progress
55+
repo-token: ${{ secrets.OG_BOT_TOKEN }}
56+
57+
label:
58+
name: Labeling 🏷️
59+
runs-on: ubuntu-latest
60+
steps:
61+
- name: Label PR depending on modified files
62+
uses: actions/labeler@v4
63+
if: ${{ github.event_name == 'pull_request_target' }}
64+
continue-on-error: true
65+
with:
66+
repo-token: '${{ secrets.OG_BOT_TOKEN }}'
67+
68+
- name: Check all PRs for merge conflicts ⛔
69+
uses: eps1lon/[email protected]
70+
with:
71+
dirtyLabel: 'merge conflict'
72+
repoToken: ${{ secrets.OG_BOT_TOKEN }}

.github/workflows/code_quality.yml

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Quality checks 👌🧪
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
5+
cancel-in-progress: true
6+
7+
on:
8+
pull_request:
9+
paths-ignore:
10+
- '**/*.md'
11+
workflow_dispatch:
12+
13+
jobs:
14+
build:
15+
name: Build frontend 🛠️
16+
runs-on: ubuntu-latest
17+
strategy:
18+
fail-fast: false
19+
defaults:
20+
run:
21+
working-directory: example
22+
23+
steps:
24+
- name: Checkout ⬇️
25+
uses: actions/checkout@v3
26+
27+
- name: Build Example Project 🛠
28+
uses: subosito/flutter-action@v2
29+
with:
30+
cache: true
31+
channel: 'stable'
32+
- run: flutter pub get
33+
# - run: flutter test
34+
- run: flutter build apk
35+
36+
# - name: Upload artifact (Client) ⬆️💻
37+
# uses: actions/[email protected]
38+
# with:
39+
# name: example
40+
# path: |
41+
# example/build/web
42+
43+
pr_context:
44+
name: Save PR context as artifact
45+
if: ${{ always() && !cancelled() && github.event_name == 'pull_request' }}
46+
runs-on: ubuntu-latest
47+
needs:
48+
# - dependency-review
49+
- build
50+
51+
steps:
52+
- name: Save PR context
53+
env:
54+
PR_NUMBER: ${{ github.event.number }}
55+
PR_SHA: ${{ github.sha }}
56+
run: |
57+
echo $PR_NUMBER > PR_number
58+
echo $PR_SHA > PR_sha
59+
60+
- name: Upload PR number as artifact
61+
uses: actions/[email protected]
62+
with:
63+
name: PR_context
64+
path: |
65+
PR_number
66+
PR_sha
67+
68+
conventional_commits:
69+
name: Conventional commits check 💬
70+
if: ${{ github.event_name == 'pull_request' }}
71+
runs-on: ubuntu-latest
72+
73+
steps:
74+
- name: Checkout ⬇️
75+
uses: actions/[email protected]
76+
77+
- name: Check if all commits comply with the specification
78+
uses: webiny/[email protected]

.github/workflows/deploy.yml

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Deploy 🏗️
2+
3+
on:
4+
workflow_run:
5+
workflows:
6+
- Quality checks 👌🧪
7+
types:
8+
- completed
9+
10+
jobs:
11+
pr-context:
12+
name: Get PR context
13+
if: ${{ always() && github.event.workflow_run.event == 'pull_request' }}
14+
runs-on: ubuntu-latest
15+
outputs:
16+
commit: ${{ env.pr_sha }}
17+
pr_number: ${{ env.pr_number }}
18+
19+
steps:
20+
- name: Get PR context ⬇️
21+
uses: dawidd6/[email protected]
22+
id: pr_context
23+
with:
24+
run_id: ${{ github.event.workflow_run.id }}
25+
name: PR_context
26+
27+
- name: Set PR context environment variables
28+
if: ${{ steps.pr_context.conclusion == 'success' }}
29+
run: |
30+
echo "pr_number=$(cat PR_number)" >> $GITHUB_ENV
31+
echo "pr_sha=$(cat PR_sha)" >> $GITHUB_ENV
32+
33+
compose-comment:
34+
name: Compose comment
35+
if: ${{ always() }}
36+
uses: ./.github/workflows/job_messages.yml
37+
needs:
38+
- pr-context
39+
40+
with:
41+
branch: ${{ github.event.workflow_run.head_branch }}
42+
commit: ${{ needs.pr-context.outputs.commit != '' && needs.pr-context.outputs.commit || github.event.workflow_run.head_sha }}
43+
preview_url: ${{ needs.cf-pages.outputs.url }}
44+
build_workflow_run_id: ${{ github.event.workflow_run.id }}
45+
commenting_workflow_run_id: ${{ github.run_id }}
46+
in_progress: false
47+
48+
comment-status:
49+
name: Create comment status
50+
if: |
51+
always() &&
52+
github.event.workflow_run.event == 'pull_request' &&
53+
needs.pr-context.outputs.pr_number != ''
54+
runs-on: ubuntu-latest
55+
needs:
56+
- compose-comment
57+
- pr-context
58+
59+
steps:
60+
- name: Update job summary in PR comment
61+
uses: thollander/[email protected]
62+
with:
63+
GITHUB_TOKEN: ${{ secrets.OG_BOT_TOKEN }}
64+
message: ${{ needs.compose-comment.outputs.msg }}
65+
pr_number: ${{ needs.pr-context.outputs.pr_number }}
66+
comment_tag: ${{ needs.compose-comment.outputs.marker }}
67+
mode: recreate

.github/workflows/job_messages.yml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Job messages ⚙️
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
branch:
7+
required: false
8+
type: string
9+
commit:
10+
required: true
11+
type: string
12+
preview_url:
13+
required: false
14+
type: string
15+
build_workflow_run_id:
16+
required: false
17+
type: number
18+
commenting_workflow_run_id:
19+
required: true
20+
type: string
21+
in_progress:
22+
required: true
23+
type: boolean
24+
outputs:
25+
msg:
26+
description: The composed message
27+
value: ${{ jobs.msg.outputs.msg }}
28+
marker:
29+
description: Hidden marker to detect PR comments composed by the bot
30+
value: 'test-deployment'
31+
32+
jobs:
33+
msg:
34+
name: Deployment status
35+
runs-on: ubuntu-latest
36+
outputs:
37+
msg: ${{ env.msg }}
38+
39+
steps:
40+
- name: Compose message 📃
41+
if: ${{ always() }}
42+
id: compose
43+
env:
44+
COMMIT: ${{ inputs.commit }}
45+
DEPLOYMENT_TYPE: ${{ inputs.branch != 'master' && '🔀 Preview' || '⚙️ Production' }}
46+
BUILD_WORKFLOW_RUN: ${{ !inputs.in_progress && format('**[View build logs](https://github.com/{0}/actions/runs/{1})**', 'gibahjoe/openapi-generator-dart', inputs.build_workflow_run_id) || '' }}
47+
COMMENTING_WORKFLOW_RUN: ${{ format('**[View bot logs](https://github.com/{0}/actions/runs/{1})**', 'gibahjoe/openapi-generator-dart', inputs.commenting_workflow_run_id) }}
48+
# EOF is needed for multiline environment variables in a GitHub Actions context
49+
run: |
50+
echo "## Cloudflare Pages deployment" > $GITHUB_STEP_SUMMARY
51+
echo "" >> $GITHUB_STEP_SUMMARY
52+
echo "| **Latest commit** | <code>${COMMIT::7}</code> |" >> $GITHUB_STEP_SUMMARY
53+
echo "|------------------------- |:----------------------------: |" >> $GITHUB_STEP_SUMMARY
54+
echo "| **Status** | $DEPLOY_STATUS |" >> $GITHUB_STEP_SUMMARY
55+
echo "| **Type** | $DEPLOYMENT_TYPE |" >> $GITHUB_STEP_SUMMARY
56+
echo "" >> $GITHUB_STEP_SUMMARY
57+
echo "$BUILD_WORKFLOW_RUN" >> $GITHUB_STEP_SUMMARY
58+
echo "$COMMENTING_WORKFLOW_RUN" >> $GITHUB_STEP_SUMMARY
59+
COMPOSED_MSG=$(cat $GITHUB_STEP_SUMMARY)
60+
echo "msg<<EOF" >> $GITHUB_ENV
61+
echo "$COMPOSED_MSG" >> $GITHUB_ENV
62+
echo "EOF" >> $GITHUB_ENV

.github/workflows/release.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Stable release 🕊️📦
2+
3+
on:
4+
release:
5+
types:
6+
- released
7+
- prereleased
8+
9+
jobs:
10+
publish:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v1
17+
- name: Publish
18+
uses: sakebook/[email protected]
19+
with:
20+
credential: ${{ secrets.PUB_CREDENTIAL_JSON }}
21+
flutter_package: true
22+
skip_test: true
23+
dry_run: true

CHANGELOG.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
## 1.0.0
1+
[openapi-generator-cli](openapi-generator-cli%2FCHANGELOG.md)
22

3-
- Initial version
3+
[openapi-generator-annotations](openapi-generator-annotations%2FCHANGELOG.md)
4+
5+
[openapi-generator](openapi-generator%2FCHANGELOG.md)

0 commit comments

Comments
 (0)