Skip to content

Commit

Permalink
chore(SNP-903): update GitHub Action workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
martynov-alex committed Feb 27, 2024
1 parent 3f76478 commit 4eca6ff
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 25 deletions.
15 changes: 3 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,21 @@ name: "Main"

on:
pull_request:
branches:
- main
- dev
push:
branches:
- main
- dev
tags-ignore:
- "**"

jobs:
get_fvm_version:
outputs:
flutter_version: ${{ steps.fvm_version.outputs.flutterSdkVersion }}
flutter_version: ${{ steps.fvm_version.outputs.flutter }}
name: "Get Flutter version from FVM"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- id: fvm_version
uses: zoexx/github-action-json-file-properties@release
with:
file_path: ".fvm/fvm_config.json"
file_path: ".fvmrc"

analysis:
needs: get_fvm_version
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/new_issue_to_pyrus_task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
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 }}
2 changes: 1 addition & 1 deletion .github/workflows/new_issues_label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
label_issues:
uses: surfstudio/flutter-ci-workflows/.github/workflows/new_issues_label.yml@main
secrets:
SECRET_ISSUES: ${{ secrets.SECRET_ISSUES }}
SECRET_ISSUES: ${{ secrets.ACCESS_TOKEN_FOR_SURFGEAR }}
2 changes: 1 addition & 1 deletion .github/workflows/new_pull_request_label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
if: ${{ github.event.label.name == 'WIP' }}
uses: surfstudio/flutter-ci-workflows/.github/workflows/new_pull_request_label.yml@main
secrets:
SECRET_ISSUES: ${{ secrets.SECRET_ISSUES }}
SECRET_ISSUES: ${{ secrets.ACCESS_TOKEN_FOR_SURFGEAR }}
2 changes: 1 addition & 1 deletion .github/workflows/new_pull_request_main_actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
pull_request:
uses: surfstudio/flutter-ci-workflows/.github/workflows/new_pull_request_label.yml@main
secrets:
SECRET_ISSUES: ${{ secrets.SECRET_ISSUES }}
SECRET_ISSUES: ${{ secrets.ACCESS_TOKEN_FOR_SURFGEAR }}
22 changes: 12 additions & 10 deletions .github/workflows/publish_to_pub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ on:
jobs:
get_fvm_version:
outputs:
flutter_version: ${{ steps.fvm_version.outputs.flutterSdkVersion }}
flutter_version: ${{ steps.fvm_version.outputs.flutter }}
name: "Get Flutter version from FVM"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- id: fvm_version
uses: zoexx/github-action-json-file-properties@release
with:
file_path: ".fvm/fvm_config.json"
file_path: ".fvmrc"

analysis:
needs: get_fvm_version
Expand All @@ -27,18 +27,20 @@ jobs:
flutter-version: ${{ needs.get_fvm_version.outputs.flutter_version }}

testing:
needs: [get_fvm_version, analysis]
needs: [analysis, get_fvm_version]
uses: surfstudio/flutter-ci-workflows/.github/workflows/testing.yml@main
secrets:
with:
flutter-version: ${{ needs.get_fvm_version.outputs.flutter_version }}
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

package-publishing:
needs: [ analysis, testing ]
needs: [analysis, testing, get_fvm_version]
uses: surfstudio/flutter-ci-workflows/.github/workflows/publish_to_pub.yml@main
with:
PANA_TOTAL: '100'
flutter-version: ${{ needs.get_fvm_version.outputs.flutter_version }}
PANA_TOTAL: "100"
secrets:
PUB_CREDENTIAL_JSON: ${{ secrets.PUB_CREDENTIAL_JSON }}
PUB_OAUTH_ACCESS_TOKEN: ${{ secrets.PUB_OAUTH_ACCESS_TOKEN }}
PUB_OAUTH_REFRESH_TOKEN: ${{ secrets.PUB_OAUTH_REFRESH_TOKEN }}
PUB_CREDENTIAL_JSON: ${{ secrets.SURF_PUB_CREDENTIAL_JSON }}
PUB_OAUTH_ACCESS_TOKEN: ${{ secrets.SURF_PUB_OAUTH_ACCESS_TOKEN }}
PUB_OAUTH_REFRESH_TOKEN: ${{ secrets.SURF_PUB_OAUTH_REFRESH_TOKEN }}

0 comments on commit 4eca6ff

Please sign in to comment.