Skip to content

Commit

Permalink
Merge pull request #77 from BerkSartik/master
Browse files Browse the repository at this point in the history
  • Loading branch information
VB10 authored Sep 1, 2023
2 parents 78a15f9 + 3a14796 commit 3281aa9
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/analyze.yml
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
23 changes: 23 additions & 0 deletions .github/workflows/publish.yml
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
43 changes: 43 additions & 0 deletions .github/workflows/test-and-publish.yml
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

0 comments on commit 3281aa9

Please sign in to comment.