From 7b783de7668b3b76a61015144a7103e892fabda0 Mon Sep 17 00:00:00 2001 From: Alex Martynov Date: Mon, 8 Apr 2024 11:46:50 +0600 Subject: [PATCH] chore(SNP-1124): Update CI workflows --- .github/ISSUE_TEMPLATE/bug_report.md | 4 +- .../ISSUE_TEMPLATE/documentation_update.md | 3 -- .github/ISSUE_TEMPLATE/feature_request.md | 3 -- .github/PULL_REQUEST_TEMPLATE.md | 3 +- .github/workflows/check_issue.yaml | 15 ------- .github/workflows/main.yml | 45 ------------------- .github/workflows/new_issue_to_pyrus_task.yml | 35 --------------- .github/workflows/new_issues_label.yml | 16 ------- .github/workflows/new_pull_request_label.yml | 17 ------- .../new_pull_request_main_actions.yml | 22 --------- ..._close_issue_add_comment_to_pyrus_task.yml | 24 ++++++++++ .../on_close_pr_add_comment_to_pyrus_task.yml | 24 ++++++++++ .../on_open_issue_create_pyrus_task.yml | 34 ++++++++++++++ .../on_open_pr_create_pyrus_task.yml | 34 ++++++++++++++ .github/workflows/on_pull_request.yml | 34 ++++++++++++++ .github/workflows/publish_to_pub.yml | 29 ++++-------- 16 files changed, 164 insertions(+), 178 deletions(-) delete mode 100644 .github/workflows/check_issue.yaml delete mode 100644 .github/workflows/main.yml delete mode 100644 .github/workflows/new_issue_to_pyrus_task.yml delete mode 100644 .github/workflows/new_issues_label.yml delete mode 100644 .github/workflows/new_pull_request_label.yml delete mode 100644 .github/workflows/new_pull_request_main_actions.yml create mode 100644 .github/workflows/on_close_issue_add_comment_to_pyrus_task.yml create mode 100644 .github/workflows/on_close_pr_add_comment_to_pyrus_task.yml create mode 100644 .github/workflows/on_open_issue_create_pyrus_task.yml create mode 100644 .github/workflows/on_open_pr_create_pyrus_task.yml create mode 100644 .github/workflows/on_pull_request.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 9f615a5..7de2e0f 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -26,6 +26,7 @@ labels: bug --> ## Details + Flutter version: Dart version: @@ -50,9 +51,10 @@ What did you try to solve the problem? --> ## Checklist for self-check + - [ ] Added expected and actual behavior. - [ ] Added video or screenshot of bug. - [ ] Added isolated way to reproduce the bug. - [ ] Specified Flutter, Dart version and platforms. - [ ] Attached error code and logs. -- [ ] All unspecified fields in the Issue description are deleted. \ No newline at end of file +- [ ] All unspecified fields in the Issue description are deleted. diff --git a/.github/ISSUE_TEMPLATE/documentation_update.md b/.github/ISSUE_TEMPLATE/documentation_update.md index 3bb3aea..3e5dd2a 100644 --- a/.github/ISSUE_TEMPLATE/documentation_update.md +++ b/.github/ISSUE_TEMPLATE/documentation_update.md @@ -7,9 +7,6 @@ labels: documentation Thank you for contributing to our project! This template is only for documentation update reports, otherwise please use another template. --> -## Specify package name - - ## Describe what scenario you think is uncovered by the existing examples / articles diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 2c2f243..fd2edc3 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -9,9 +9,6 @@ labels: enhancement Provide thoughtful commentary *and code samples* on what this feature means for your product. What will it allow you to do that you can't do today? How will it make current workarounds straightforward? What potential bugs and edge cases does it help to avoid? etc. Please keep it product-centric. --> -## Specify package name - - ## What is the new or updated feature that you are suggesting? diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index ba5f1df..488b52c 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,6 +1,7 @@ Tap on "Preview" ⤴ And choose one of the templates: + * [Bugfix PR](?expand=1&template=bug_fix.md) * [New feature PR](?expand=1&template=new_feature.md) -* [Documentation update PR](?expand=1&template=documentation_update.md) \ No newline at end of file +* [Documentation update PR](?expand=1&template=documentation_update.md) diff --git a/.github/workflows/check_issue.yaml b/.github/workflows/check_issue.yaml deleted file mode 100644 index 4b6f6f1..0000000 --- a/.github/workflows/check_issue.yaml +++ /dev/null @@ -1,15 +0,0 @@ -name: "Checking issue for correctness of described" - -on: - issues: - types: - - reopened - - opened - -jobs: - check-issue: - uses: surfstudio/flutter-ci-workflows/.github/workflows/check_issues.yaml@main - with: - REPO_PATH: 'https://github.com/surfstudio/flutter-bottom-sheet/issues/new/choose' - ISSUE_TITLE: ${{ github.event.issue.title }} - ISSUE_BODY: ${{ github.event.issue.body }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index db4dd38..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: "Main" - -on: - pull_request: - -jobs: - get_fvm_version: - outputs: - flutter_version: ${{ steps.fvm_version.outputs.flutter }} - name: "Get Flutter version from FVM" - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - id: fvm_version - uses: zoexx/github-action-json-file-properties@release - with: - file_path: ".fvmrc" - - analysis: - needs: get_fvm_version - uses: surfstudio/flutter-ci-workflows/.github/workflows/analysis.yml@main - with: - flutter-version: ${{ needs.get_fvm_version.outputs.flutter_version }} - - testing: - needs: [analysis, get_fvm_version] - uses: surfstudio/flutter-ci-workflows/.github/workflows/testing.yml@main - with: - flutter-version: ${{ needs.get_fvm_version.outputs.flutter_version }} - secrets: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - - build_android_example: - needs: [analysis, get_fvm_version] - uses: surfstudio/flutter-ci-workflows/.github/workflows/build_android_example.yml@main - with: - flutter-version: ${{ needs.get_fvm_version.outputs.flutter_version }} - - build_ios_example: - needs: [analysis, get_fvm_version] - uses: surfstudio/flutter-ci-workflows/.github/workflows/build_ios_example.yml@main - with: - flutter-version: ${{ needs.get_fvm_version.outputs.flutter_version }} diff --git a/.github/workflows/new_issue_to_pyrus_task.yml b/.github/workflows/new_issue_to_pyrus_task.yml deleted file mode 100644 index 36813f6..0000000 --- a/.github/workflows/new_issue_to_pyrus_task.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: "Create Pyrus task from issue" - -on: - issues: - types: - - reopened - - opened - -jobs: - get_package_name: - name: Get package name - runs-on: ubuntu-latest - outputs: - package_name: ${{ steps.parse_pubspec.outputs.name }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Parsing pubspec.yaml - id: parse_pubspec - uses: actions-tools/yaml-outputs@v2 - with: - file-path: 'pubspec.yaml' - - call_create_pyrus_task_from_issue: - name: Create Pyrus task from issue - needs: get_package_name - uses: surfstudio/flutter-ci-workflows/.github/workflows/new_issue_to_pyrus_task.yml@main - with: - PACKAGE_NAME: ${{ needs.get_package_name.outputs.package_name }} - ISSUE_TITLE: ${{ github.event.issue.title }} - ISSUE_BODY: ${{ github.event.issue.body }} - ISSUE_LINK: ${{ github.event.issue.html_url }} - secrets: - LOGIN: ${{ secrets.PYRUS_BOT_LOGIN }} - SECURITY_KEY: ${{ secrets.PYRUS_BOT_SECRET_KEY }} diff --git a/.github/workflows/new_issues_label.yml b/.github/workflows/new_issues_label.yml deleted file mode 100644 index 58890cc..0000000 --- a/.github/workflows/new_issues_label.yml +++ /dev/null @@ -1,16 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -name: Label issues -on: - issues: - types: - - reopened - - opened -jobs: - label_issues: - uses: surfstudio/flutter-ci-workflows/.github/workflows/new_issues_label.yml@main - secrets: - SECRET_ISSUES: ${{ secrets.ACCESS_TOKEN_FOR_SURFGEAR }} diff --git a/.github/workflows/new_pull_request_label.yml b/.github/workflows/new_pull_request_label.yml deleted file mode 100644 index 9fd27c2..0000000 --- a/.github/workflows/new_pull_request_label.yml +++ /dev/null @@ -1,17 +0,0 @@ -# This workflow is triggered when a WIP label is added to an open pull request. -# When deleting the WIP label, the new_pull_request label is added. -# When adding a WIP label, the new_pull_request label is removed if there is one. - -name: Pull-request label tracking -on: - pull_request_target: - types: - - labeled - - unlabeled - -jobs: - label_pull_request: - if: ${{ github.event.label.name == 'WIP' }} - uses: surfstudio/flutter-ci-workflows/.github/workflows/new_pull_request_label.yml@main - secrets: - SECRET_ISSUES: ${{ secrets.ACCESS_TOKEN_FOR_SURFGEAR }} diff --git a/.github/workflows/new_pull_request_main_actions.yml b/.github/workflows/new_pull_request_main_actions.yml deleted file mode 100644 index 0bbf1ca..0000000 --- a/.github/workflows/new_pull_request_main_actions.yml +++ /dev/null @@ -1,22 +0,0 @@ -# This workflow is triggered when a pull request opened, edited, reopened, -# converted_to_draft and ready_for_review. -# -# There is no WIP in the title, there is no WIP label and the pull request is not a draft the -# new pull request label is added. -# If either of these is true then remove the label new pull request if there is one. - -name: Pull-request tracking -on: - pull_request_target: - types: - - opened - - edited - - reopened - - converted_to_draft - - ready_for_review - -jobs: - pull_request: - uses: surfstudio/flutter-ci-workflows/.github/workflows/new_pull_request_label.yml@main - secrets: - SECRET_ISSUES: ${{ secrets.ACCESS_TOKEN_FOR_SURFGEAR }} \ No newline at end of file diff --git a/.github/workflows/on_close_issue_add_comment_to_pyrus_task.yml b/.github/workflows/on_close_issue_add_comment_to_pyrus_task.yml new file mode 100644 index 0000000..9620448 --- /dev/null +++ b/.github/workflows/on_close_issue_add_comment_to_pyrus_task.yml @@ -0,0 +1,24 @@ +name: Add comment to Pyrus task on issue close + +on: + issues: + types: + - closed + +jobs: + get_pyrus_task_id: + name: Get Pyrus task ID from special comment in issue + uses: surfstudio/flutter-ci-workflows/.github/workflows/get_pyrus_task_id_from_issue_or_pr_comment.yml@main + with: + ISSUE_NUMBER: ${{ github.event.issue.number }} + + add_comment_to_pyrus_task: + name: Add comment to Pyrus task + needs: get_pyrus_task_id + uses: surfstudio/flutter-ci-workflows/.github/workflows/add_comment_to_pyrus_task.yml@main + with: + PYRUS_TASK_ID: ${{ needs.get_pyrus_task_id.outputs.PYRUS_TASK_ID }} + COMMENT_TEXT: The issue is closed. + secrets: + LOGIN: ${{ secrets.PYRUS_BOT_LOGIN }} + SECURITY_KEY: ${{ secrets.PYRUS_BOT_SECRET_KEY }} diff --git a/.github/workflows/on_close_pr_add_comment_to_pyrus_task.yml b/.github/workflows/on_close_pr_add_comment_to_pyrus_task.yml new file mode 100644 index 0000000..b7d21b4 --- /dev/null +++ b/.github/workflows/on_close_pr_add_comment_to_pyrus_task.yml @@ -0,0 +1,24 @@ +name: Add comment to Pyrus task on PR close + +on: + pull_request: + types: + - closed + +jobs: + get_pyrus_task_id: + name: Get Pyrus task ID from special comment in issue + uses: surfstudio/flutter-ci-workflows/.github/workflows/get_pyrus_task_id_from_issue_or_pr_comment.yml@main + with: + ISSUE_NUMBER: ${{ github.event.pull_request.number }} + + add_comment_to_pyrus_task: + name: Add comment to Pyrus task + needs: get_pyrus_task_id + uses: surfstudio/flutter-ci-workflows/.github/workflows/add_comment_to_pyrus_task.yml@main + with: + PYRUS_TASK_ID: ${{ needs.get_pyrus_task_id.outputs.PYRUS_TASK_ID }} + COMMENT_TEXT: The pull request is closed. + secrets: + LOGIN: ${{ secrets.PYRUS_BOT_LOGIN }} + SECURITY_KEY: ${{ secrets.PYRUS_BOT_SECRET_KEY }} diff --git a/.github/workflows/on_open_issue_create_pyrus_task.yml b/.github/workflows/on_open_issue_create_pyrus_task.yml new file mode 100644 index 0000000..75c5014 --- /dev/null +++ b/.github/workflows/on_open_issue_create_pyrus_task.yml @@ -0,0 +1,34 @@ +name: Create Pyrus task from new issue + +on: + issues: + types: + - opened + - reopened + +jobs: + get_package_name: + uses: surfstudio/flutter-ci-workflows/.github/workflows/get_package_name.yml@main + + create_pyrus_task: + name: Create Pyrus task from issue + needs: get_package_name + uses: surfstudio/flutter-ci-workflows/.github/workflows/create_pyrus_task_from_issue_or_pr.yml@main + with: + TYPE: Issue + PACKAGE_NAME: ${{ needs.get_package_name.outputs.package_name }} + TITLE: ${{ github.event.issue.title }} + LINK: ${{ github.event.issue.html_url }} + secrets: + LOGIN: ${{ secrets.PYRUS_BOT_LOGIN }} + SECURITY_KEY: ${{ secrets.PYRUS_BOT_SECRET_KEY }} + + add_pyrus_task_link: + name: Add Pyrus task link + needs: create_pyrus_task + uses: surfstudio/flutter-ci-workflows/.github/workflows/add_comment_to_issue_or_pr.yml@main + with: + ISSUE_NUMBER: ${{ github.event.issue.number }} + # Don't change the comment link, because the Pyrus task ID is searched by the link text + COMMENT_TEXT: "[Link to Pyrus task](https://pyrus.com/t#id${{ needs.create_pyrus_task.outputs.TASK_ID }})" + REACTIONS: rocket diff --git a/.github/workflows/on_open_pr_create_pyrus_task.yml b/.github/workflows/on_open_pr_create_pyrus_task.yml new file mode 100644 index 0000000..4c4b693 --- /dev/null +++ b/.github/workflows/on_open_pr_create_pyrus_task.yml @@ -0,0 +1,34 @@ +name: Create Pyrus task from new PR + +on: + pull_request: + types: + - opened + - reopened + +jobs: + get_package_name: + uses: surfstudio/flutter-ci-workflows/.github/workflows/get_package_name.yml@main + + create_pyrus_task: + name: Create Pyrus task from pull request + needs: get_package_name + uses: surfstudio/flutter-ci-workflows/.github/workflows/create_pyrus_task_from_issue_or_pr.yml@main + with: + TYPE: Pull request + PACKAGE_NAME: ${{ needs.get_package_name.outputs.package_name }} + TITLE: ${{ github.event.pull_request.title }} + LINK: ${{ github.event.pull_request.html_url }} + secrets: + LOGIN: ${{ secrets.PYRUS_BOT_LOGIN }} + SECURITY_KEY: ${{ secrets.PYRUS_BOT_SECRET_KEY }} + + add_pyrus_task_link: + name: Add Pyrus task link + needs: create_pyrus_task + uses: surfstudio/flutter-ci-workflows/.github/workflows/add_comment_to_issue_or_pr.yml@main + with: + ISSUE_NUMBER: ${{ github.event.pull_request.number }} + # Don't change the comment link, because the Pyrus task ID is searched by the link text + COMMENT_TEXT: "[Link to Pyrus task](https://pyrus.com/t#id${{ needs.create_pyrus_task.outputs.TASK_ID }})" + REACTIONS: rocket diff --git a/.github/workflows/on_pull_request.yml b/.github/workflows/on_pull_request.yml new file mode 100644 index 0000000..fe5df78 --- /dev/null +++ b/.github/workflows/on_pull_request.yml @@ -0,0 +1,34 @@ +name: On pull request + +on: + pull_request: + +jobs: + get_flutter_version: + uses: surfstudio/flutter-ci-workflows/.github/workflows/get_flutter_version.yml@main + + analysis: + needs: get_flutter_version + uses: surfstudio/flutter-ci-workflows/.github/workflows/analysis.yml@main + with: + FLUTTER_VERSION: ${{ needs.get_flutter_version.outputs.FLUTTER_VERSION }} + + testing: + needs: [analysis, get_flutter_version] + uses: surfstudio/flutter-ci-workflows/.github/workflows/testing.yml@main + with: + FLUTTER_VERSION: ${{ needs.get_flutter_version.outputs.FLUTTER_VERSION }} + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + + build_android_example: + needs: [analysis, get_flutter_version] + uses: surfstudio/flutter-ci-workflows/.github/workflows/build_android_example.yml@main + with: + FLUTTER_VERSION: ${{ needs.get_flutter_version.outputs.FLUTTER_VERSION }} + + build_ios_example: + needs: [analysis, get_flutter_version] + uses: surfstudio/flutter-ci-workflows/.github/workflows/build_ios_example.yml@main + with: + FLUTTER_VERSION: ${{ needs.get_flutter_version.outputs.FLUTTER_VERSION }} diff --git a/.github/workflows/publish_to_pub.yml b/.github/workflows/publish_to_pub.yml index 504a9be..ca0058f 100644 --- a/.github/workflows/publish_to_pub.yml +++ b/.github/workflows/publish_to_pub.yml @@ -1,4 +1,4 @@ -name: "Publishing" +name: Publishing on: push: @@ -6,39 +6,28 @@ on: - v* jobs: - get_fvm_version: - outputs: - flutter_version: ${{ steps.fvm_version.outputs.flutter }} - name: "Get Flutter version from FVM" - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - id: fvm_version - uses: zoexx/github-action-json-file-properties@release - with: - file_path: ".fvmrc" + get_flutter_version: + uses: surfstudio/flutter-ci-workflows/.github/workflows/get_flutter_version.yml@main analysis: - needs: get_fvm_version + needs: get_flutter_version uses: surfstudio/flutter-ci-workflows/.github/workflows/analysis.yml@main with: - flutter-version: ${{ needs.get_fvm_version.outputs.flutter_version }} + FLUTTER_VERSION: ${{ needs.get_flutter_version.outputs.FLUTTER_VERSION }} testing: - needs: [analysis, get_fvm_version] + needs: [analysis, get_flutter_version] uses: surfstudio/flutter-ci-workflows/.github/workflows/testing.yml@main with: - flutter-version: ${{ needs.get_fvm_version.outputs.flutter_version }} + FLUTTER_VERSION: ${{ needs.get_flutter_version.outputs.FLUTTER_VERSION }} secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} package-publishing: - needs: [analysis, testing, get_fvm_version] + needs: [analysis, testing, get_flutter_version] uses: surfstudio/flutter-ci-workflows/.github/workflows/publish_to_pub.yml@main with: - flutter-version: ${{ needs.get_fvm_version.outputs.flutter_version }} + FLUTTER_VERSION: ${{ needs.get_flutter_version.outputs.FLUTTER_VERSION }} PANA_TOTAL: "100" secrets: PUB_CREDENTIAL_JSON: ${{ secrets.SURF_PUB_CREDENTIAL_JSON }}