Skip to content

Commit

Permalink
CI: Flutter build / Check if PR is needed (#39)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: github-actions <[email protected]>
  • Loading branch information
thelukewalton and github-actions authored Apr 29, 2024
1 parent 709c1ac commit 435acaf
Show file tree
Hide file tree
Showing 6 changed files with 1,275 additions and 1,239 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
- name: Check if PR exists
run: echo "pr_exists=$(gh pr list -H icon-updates --json number -q length)" >> $GITHUB_ENV
- name: Create Pull Request
if: ${{env.pr_exists == 0}}
if: ${{env.pr_exists == 0 && steps.fetch_icons.outputs.files_changed == 'true'}}
run: gh pr create -B main -H ${{env.UPDATE_BRANCH_NAME}} --title "feat:${{env.UPDATE_BRANCH_NAME}}" --body 'Created by the Zeta Icons bot'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .github/workflows/update_zeta_flutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
- name: Get package version
id: package-version
uses: martinbeentjes/[email protected]
- name: Inject version
run: sed -i 's/VERSION_NUM/${{steps.package-version.outputs.current-version}}/g' outputs/definitions/icons.dart
- name: Push dart file to Zeta Flutter (branch exists)
uses: dmnemec/copy_file_to_another_repo_action@main
if: ${{env.branch_exists == 1}}
Expand Down
9 changes: 5 additions & 4 deletions dist/scripts/generators/generateDefinitionFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ export const generateDefinitionFiles = (outputDir, definitionsOutputDir, fontDat
*/
const generateDartFile = (fontData) => {
let dartTemplate = readFileSync("./scripts/templates/icons.dart.template").toString();
const roundIcons = fontData.dartRoundTypes.join("\n");
const sharpIcons = fontData.dartSharpTypes.join("\n");
const roundList = fontData.dartRoundList.join(",\n") + ",";
const sharpList = fontData.dartSharpList.join(",\n") + ",";
const newLine = "\n ";
const roundIcons = fontData.dartRoundTypes.join(newLine);
const sharpIcons = fontData.dartSharpTypes.join(newLine);
const roundList = fontData.dartRoundList.join(newLine) + ",";
const sharpList = fontData.dartSharpList.join(newLine) + ",";
dartTemplate = dartTemplate.replace("{{roundIcons}}", roundIcons);
dartTemplate = dartTemplate.replace("{{sharpIcons}}", sharpIcons);
dartTemplate = dartTemplate.replace("{{sharpIconList}}", sharpList);
Expand Down
Loading

0 comments on commit 435acaf

Please sign in to comment.