Skip to content

Commit

Permalink
Merge pull request #4 from sakebook/feature/channel
Browse files Browse the repository at this point in the history
Add option package type
  • Loading branch information
sakebook authored Oct 21, 2019
2 parents 86019dc + 83f6b0b commit 05f67f0
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 5 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/test_dart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on:
push:
branches:
- 'test/*'
- '!master'
jobs:
test_job:
runs-on: ubuntu-latest
name: Test
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Test action
uses: ./
with:
credential: "{}"
flutter_package: false
skip_test: true
File renamed without changes.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ This action publishing the Flutter plugin.

**Required** Google Account credential.

### `flutter_package`

**Optional** Publish packages type. Default: `true`

### `skip_test`

**Optional** Skip test. Default: `false`
Expand All @@ -30,8 +34,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v1
- name: Publish
uses: sakebook/actions-flutter-pub-publisher@v1.0.3
uses: sakebook/actions-flutter-pub-publisher@v1.1.0
with:
credential: ${{ secrets.CREDENTIAL_JSON }}
flutter_package: false
skip_test: true
```
8 changes: 6 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# action.yml
name: 'Publish Dart package'
description: 'Publish Dart package'
name: 'Publish Dart/Flutter package'
description: 'Publish Dart/Flutter package'
inputs:
credential:
description: 'Google Account credential'
required: true
flutter_package:
description: '(Optional) Publish packages type. (default: true)'
required: false
default: true
skip_test:
description: '(Optional) Skip test (default: false)'
required: false
Expand Down
18 changes: 16 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,26 @@ run_test_if_needed() {
fi
}

publish_package() {
echo "Publish to Pub"
publish_package_dart() {
echo "Publish dart package to Pub"
pub publish --dry-run
pub publish -f
}

publish_package_flutter() {
echo "Publish flutter package to Pub"
flutter pub pub publish --dry-run
flutter pub pub publish -f
}

publish_package() {
if "${INPUT_FLUTTER_PACKAGE}"; then
publish_package_flutter
else
publish_package_dart
fi
}

check_credentials
copy_credential
run_test_if_needed
Expand Down

0 comments on commit 05f67f0

Please sign in to comment.