-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from BerkSartik/master
- Loading branch information
Showing
3 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Analyze the code when a new push and PR | ||
run-name: Analyze action triggered by @${{ github.actor }} | ||
|
||
# This action will only work when push and PR to "main" branch. | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- "**.md" | ||
# "workflow_dispatch" for manual trigger | ||
workflow_dispatch: | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze the Repository | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@main | ||
- uses: subosito/flutter-action@master | ||
with: | ||
channel: "stable" | ||
- run: flutter --version | ||
- run: flutter pub get | ||
- run: flutter analyze lib example/lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Publish to pub.dev | ||
run-name: Publish action triggered by @${{ github.actor }} | ||
|
||
on: | ||
release: | ||
types: [published] | ||
# "workflow_dispatch" for manual trigger | ||
workflow_dispatch: | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@main | ||
- name: Publish to Pub.dev | ||
uses: k-paxian/dart-package-publisher@master | ||
with: | ||
accessToken: ${{ secrets.OAUTH_ACCESS_TOKEN }} | ||
refreshToken: ${{ secrets.OAUTH_REFRESH_TOKEN }} | ||
credentialJson: ${{ secrets.CREDENTIAL_JSON }} | ||
flutter: true | ||
skipTests: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Test and Publish to pub.dev | ||
run-name: Test and Publish action triggered by @${{ github.actor }} | ||
|
||
on: | ||
release: | ||
types: [published] | ||
# "workflow_dispatch" for manual trigger | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test-before-publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@main | ||
- name: Install Flutter(Stable) | ||
uses: subosito/flutter-action@master | ||
with: | ||
channel: "stable" | ||
- name: Install Dependencies | ||
run: flutter pub get | ||
- name: Analyze the Repository | ||
run: flutter analyze lib example/lib | ||
- name: Run All Tests | ||
run: flutter test | ||
- name: Check Publish Warnings | ||
run: dart pub publish --dry-run | ||
|
||
publish: | ||
# if test is successful it will be published on pub.dev | ||
needs: test-before-publish | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@main | ||
- name: Publish to Pub.dev | ||
uses: k-paxian/dart-package-publisher@master | ||
with: | ||
accessToken: ${{ secrets.OAUTH_ACCESS_TOKEN }} | ||
refreshToken: ${{ secrets.OAUTH_REFRESH_TOKEN }} | ||
credentialJson: ${{ secrets.CREDENTIAL_JSON }} | ||
flutter: true | ||
skipTests: true |