generated from nimblehq/git-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#225] Generate sample project as a part of test workflow
- Loading branch information
Showing
2 changed files
with
52 additions
and
57 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -88,3 +88,55 @@ 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: | ||
token: ${{ secrets.WIKI_ACTION_TOKEN }} | ||
ref: ${{ github.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 |