-
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.
- Loading branch information
1 parent
6573c58
commit 3a14796
Showing
1 changed file
with
43 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,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 |