Skip to content

Commit

Permalink
Merge pull request #194 from nimblehq/release/1.7.0
Browse files Browse the repository at this point in the history
Release 1.7.0
  • Loading branch information
luongvo authored Apr 28, 2023
2 parents a50ef69 + 2944906 commit 2440843
Show file tree
Hide file tree
Showing 140 changed files with 460 additions and 710 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/android_deploy_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'

- name: Generate new project
run: make run PACKAGE_NAME=co.nimblehq.flutter.template PROJECT_NAME=flutter_templates APP_NAME="Flutter Templates"

- name: Set up Java JDK
uses: actions/setup-java@v3
with:
Expand All @@ -34,6 +26,15 @@ jobs:
channel: 'stable'
flutter-version: '3.3.10'

- name: Generate new project
run: |
dart pub global activate mason_cli
mason get
mason make template -c mason-config.json
# Move the generated project to the root directory for next steps & cleanup to not affect static code analysis
rsync -av --remove-source-files flutter_templates/ ./
rm -rf bricks/template
- name: Get Flutter dependencies
run: flutter pub get

Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/android_deploy_production_to_playstore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'

- name: Generate new project
run: make run PACKAGE_NAME=co.nimblehq.flutter.template PROJECT_NAME=flutter_templates APP_NAME="Flutter Templates"

- name: Set up Java JDK
uses: actions/setup-java@v3
with:
Expand All @@ -34,6 +26,15 @@ jobs:
channel: 'stable'
flutter-version: '3.3.10'

- name: Generate new project
run: |
dart pub global activate mason_cli
mason get
mason make template -c mason-config.json
# Move the generated project to the root directory for next steps & cleanup to not affect static code analysis
rsync -av --remove-source-files flutter_templates/ ./
rm -rf bricks/template
- name: Get Flutter dependencies
run: flutter pub get

Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/android_deploy_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'

- name: Generate new project
run: make run PACKAGE_NAME=co.nimblehq.flutter.template PROJECT_NAME=flutter_templates APP_NAME="Flutter Templates"

- name: Set up Java JDK
uses: actions/setup-java@v3
with:
Expand All @@ -35,6 +27,15 @@ jobs:
channel: 'stable'
flutter-version: '3.3.10'

- name: Generate new project
run: |
dart pub global activate mason_cli
mason get
mason make template -c mason-config.json
# Move the generated project to the root directory for next steps & cleanup to not affect static code analysis
rsync -av --remove-source-files flutter_templates/ ./
rm -rf bricks/template
- name: Get Flutter dependencies
run: flutter pub get

Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/bump_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout the latest code
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set new version
id: set_version
run: |
perl -i -pe 's/^(version:\s+\d+\.\d+\.\d+\+)(\d+)$/"version: ${{ github.event.inputs.newVersion }}+".($2+1)/e' ./template/pubspec.yaml
uses: jossef/[email protected]
with:
file: mason-config.json
field: app_version
value: ${{ github.event.inputs.newVersion }}

- name: Create pull request
uses: peter-evans/create-pull-request@v4
Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/ios_deploy_staging_to_firebase.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: ios-deploy-to-staging
on:
# Trigger the workflow on push action
push:
branches:
- develop

jobs:
build_and_upload_staging_app_to_firebase:
name: Build And Upload iOS Staging Application To Firebase
runs-on: macOS-latest
env:
TEAM_ID: ${{ secrets.TEAM_ID }}
FASTLANE_USER: ${{ secrets.FASTLANE_USER }}
FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }}
FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: ${{ secrets.FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD }}
FASTLANE_SESSION: ${{ secrets.FASTLANE_SESSION }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install SSH key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Set up Flutter environment
uses: subosito/flutter-action@v1
with:
channel: 'stable'
flutter-version: '3.3.10'

- name: Generate new project
run: |
dart pub global activate mason_cli
mason get
mason make template -c mason-config.json
# Move the generated project to the root directory for next steps & cleanup to not affect static code analysis
rsync -av --remove-source-files flutter_templates/ ./
rm -rf bricks/template
- name: Get Flutter dependencies
run: flutter pub get

- name: Set up .env.staging
env:
ENV_STAGING: ${{ secrets.ENV_STAGING }}
run: |
echo $ENV_STAGING > .env.staging
- name: Run code generator
run: flutter packages pub run build_runner build --delete-conflicting-outputs

- name: Bundle install
run: cd ./ios && bundle install

- name: Pod install
run: cd ./ios && pod install

- name: Match Adhoc
run: cd ./ios && bundle exec fastlane sync_adhoc_staging_signing

- name: Deploy to Firebase
run: |
cd ./ios && bundle exec fastlane build_and_upload_staging_app
env:
FIREBASE_CLI_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }}
20 changes: 11 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,24 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/[email protected]

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'

- name: Generate new project
run: make run PACKAGE_NAME=co.nimblehq.flutter.template PROJECT_NAME=flutter_templates APP_NAME="Flutter Templates"
- name: Checkout
uses: actions/checkout@v3

- name: Set up Flutter environment
uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.3.10'

- name: Generate new project
run: |
dart pub global activate mason_cli
mason get
mason make template -c mason-config.json
# Move the generated project to the root directory for next steps & cleanup to not affect static code analysis
rsync -av --remove-source-files flutter_templates/ ./
rm -rf bricks/template
- name: Get Flutter dependencies
run: flutter pub get

Expand Down
12 changes: 8 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Miscellaneous
.DS_Store

# Python
.venv/
scripts/__pycache__/

# VSCode
.vscode

# Intellij
*.iml
.idea/*

# Mason
mason-lock.json
.mason/
53 changes: 0 additions & 53 deletions Makefile

This file was deleted.

37 changes: 13 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Flutter Templates

All the templates that can be used to kick off a new Flutter application quickly.
All the templates can be used to kick off a new Flutter application quickly.

## Usage

Expand All @@ -10,43 +10,32 @@ Clone the repository

## Documentation

Checkout the [Wiki](https://github.com/nimblehq/flutter-templates/wiki) page to access the full documentation.
Check out the [Wiki](https://github.com/nimblehq/flutter-templates/wiki) page to access the full documentation.

## Use the template

### Setup a new project

- To set up a new project from the template, run the command:
Before using the template, ensure that you have installed the following prerequisites on your system:

- `$ make run PACKAGE_NAME={com.your.package} PROJECT_NAME={your_project_name} APP_NAME="{Your App Name}"`
- Flutter 3.3.10
- [Mason CLI](https://pub.dev/packages/mason_cli) 0.1.0-dev.44

- Then clean the project: `$ fvm flutter clean`
Follow these steps to set up a new project from the template:

- Re-fetch the project: `$ fvm flutter pub get`
- Fetch all required bricks by running the command:

- Parameters detail:
`$ mason get`

| Parameter name | Is mandatory | Description |
| :------------- | :----------: | :------------------------------------------------------------------------------ |
| PACKAGE_NAME | Yes | The application package name. The naming convention follows `com.your.package` |
| PROJECT_NAME | Yes | The application project name. The naming convention follows `your_project_name` |
| APP_NAME | Yes | The application name. |
- Generate the new project by running the following command:

More available configs [here](https://github.com/nimblehq/flutter-templates/wiki/Generating-A-Project)
`$ mason make template`

- For more supporting commands, run:
> You can find the detailed information on `make` command options and usage in the [Mason documentation](https://github.com/felangel/mason/tree/master/packages/mason_cli#overview).
- `$ make`
- Once the project is generated at `/{project_name}`, please refer to the [Getting Started](https://github.com/nimblehq/flutter-templates/tree/develop/bricks/template/__brick__/%7B%7Bproject_name.snakeCase()%7D%7D#getting-started) documentation to make it ready for development.

- Or `$ make help`

### Maintain the template

- While implementing a new feature or fixing an issue, there may be a chance to break the functions of `setup.py` script due to the change in the codebase (update the app name, the package directory, etc.).

- To make sure that the `setup.py` script is still working correctly, run the command:

- `$ make test`
That's it! You have now set up a new Flutter project using the template 🎉

## License

Expand Down
3 changes: 3 additions & 0 deletions bricks/template/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 0.1.0+1

- TODO: Describe initial release.
1 change: 1 addition & 0 deletions bricks/template/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TODO: Add your license here.
21 changes: 21 additions & 0 deletions bricks/template/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# template

[![Powered by Mason](https://img.shields.io/endpoint?url=https%3A%2F%2Ftinyurl.com%2Fmason-badge)](https://github.com/felangel/mason)

A new brick created with the Mason CLI.

_Generated by [mason][1] 🧱_

## Getting Started 🚀

This is a starting point for a new brick.
A few resources to get you started if this is your first brick template:

- [Official Mason Documentation][2]
- [Code generation with Mason Blog][3]
- [Very Good Livestream: Felix Angelov Demos Mason][4]

[1]: https://github.com/felangel/mason
[2]: https://github.com/felangel/mason/tree/master/packages/mason_cli#readme
[3]: https://verygood.ventures/blog/code-generation-with-mason
[4]: https://youtu.be/G4PTjA6tpTU
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout the latest code
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set new version
id: set_version
run: |
perl -i -pe 's/^(version:\s+\d+\.\d+\.\d+\+)(\d+)$/"version: ${{ github.event.inputs.newVersion }}+".($2+1)/e' ./pubspec.yaml
Expand Down
Loading

0 comments on commit 2440843

Please sign in to comment.