Skip to content

Commit

Permalink
Merge pull request #259 from nimblehq/feature/255-generate-sample
Browse files Browse the repository at this point in the history
  • Loading branch information
luongvo authored Aug 22, 2023
2 parents b2851fd + c8c6983 commit 28da793
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 62 deletions.
57 changes: 0 additions & 57 deletions .github/workflows/generate_sample.yml

This file was deleted.

56 changes: 51 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ on:
# but push action is only for the feature branch
pull_request:
types: [ opened, synchronize, reopened ]
push:
branches-ignore:
- develop
- 'release/**'
- main

jobs:
test:
Expand Down Expand Up @@ -88,3 +83,54 @@ jobs:
git add bricks
git commit -m "[Chore] Generate Mason bundle"
git push
generate_sample_project:
# The job generate_sample_project identify that the job generate_mason_bundle must complete successfully
# before this generate_sample_project job will run
needs: generate_mason_bundle
name: Generate the sample project
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Check out
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}

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

- name: Remove the old sample project
run: |
rm -rf sample
- name: Set the project name "sample"
uses: jossef/[email protected]
with:
file: mason-config.json
field: project_name
value: sample

- name: Generate the new sample project
run: |
dart pub global activate mason_cli
mason get
mason make template -c mason-config.json
- id: changes
name: Check for changes in the sample project
run: |
count=$(git status sample --porcelain | wc -l)
echo "count=$count" >> $GITHUB_OUTPUT
- name: Commit & push the sample project changes
if: steps.changes.outputs.count > 0
run: |
git config user.name team-nimblehq
git config user.email [email protected]
git add sample
git commit -m "[Chore] Generate & update sample project"
git push

0 comments on commit 28da793

Please sign in to comment.