Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Add tokens PR action #475

Merged
merged 4 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/tokens-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Create Design Tokens PR
on:
push:
branches:
- "design-tokens-**"

jobs:
pull-request:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}

- name: Set up Flutter
uses: "./.github/actions/setup"

- name: Generate tokens files
run: melos gen_theme

- name: Commit changes
run: |
git config --local user.email "[email protected]"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a user that we should use here? In design-tokens repo we use [email protected]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, this one is fine.

git config --local user.name "mews-tech"

git add .
git commit -m "Update generated files"

git push origin ${{ github.ref_name }}

- name: Create Pull Request
run: |
gh pr create \
--base master \
--head ${{ github.ref_name }} \
--title 'feat: Design Tokens Update' \
--body 'Design Tokens were updated! This PR was created to update the code.' \
--reviwer MewsSystems/tech.mo.platform.owners
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 6 additions & 1 deletion melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ command:
workspaceChangelog: false

scripts:
gen_icons: melos exec --scope="storybook" -- "dart utils/gen_icons.dart $MELOS_ROOT_PATH/optimus/lib/fonts/config/ lib/stories/icon && dart format lib/stories/icon/icons_list.dart"
gen_icons:
run: melos exec --scope="storybook" -- "dart utils/gen_icons.dart $MELOS_ROOT_PATH/optimus/lib/fonts/config/ lib/stories/icon && dart format lib/stories/icon/icons_list.dart"
description: Generate the list of all icons for the storybook story
gen_theme:
run: melos exec --depends-on=build_runner -- "dart run build_runner build -d"
description: Build all generated files

packages:
- "**"