Skip to content

Commit

Permalink
feat: Created script to generate Android icons
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecoomber authored Oct 18, 2024
2 parents 6835652 + fde3402 commit 4154878
Show file tree
Hide file tree
Showing 11 changed files with 379 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ jobs:
update_flutter:
uses: ./.github/workflows/update_zeta_flutter.yml
secrets: inherit

update_android:
uses: ./.github/workflows/update_zds_android.yml
secrets: inherit
19 changes: 19 additions & 0 deletions .github/workflows/update_zds_android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Update zds_android

on:
workflow_dispatch:
workflow_call:
secrets:
PAT:
required: true

jobs:
publish_android:
uses: ./.github/workflows/copy-content.yml
secrets: inherit
with:
repo: ZebraDevs/zds_android
branch: "update-zeta-icons"
source_dir: "./outputs/android/."
destination_dir: "components/src/main/res/drawable"
commit_msg: "Update icons"
225 changes: 225 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"@types/react": "^18.3.11",
"@types/sinon": "^17.0.3",
"chai": "^5.1.0",
"cheerio": "^1.0.0",
"dotenv": "^16.4.5",
"jest": "^29.7.0",
"md5": "^2.3.0",
Expand Down Expand Up @@ -73,4 +74,4 @@
"url": "https://github.com/zebratechnologies/zeta-icons/issues"
},
"homepage": "https://github.com/zebratechnologies/zeta-icons#readme"
}
}
6 changes: 6 additions & 0 deletions scripts/fetch-icons/fetchIcons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ import { clearDirectory } from "../utils/fileUtils.js";
import { generateHash } from "../utils/hash.js";
import { optimizeSVGs } from "../utils/optimizeSvgs.js";
import { saveSVGs } from "../utils/saveSvgs.js";
import { generateAndroidIcons } from "./generators/generateAndroidIcons.js";

export const iconsDir = "/icons";
export const tempDir = "/temp";
export const pngDir = "/png";
export const flutterDir = "/flutter";
export const webDir = "/web";
export const androidDir = "/android";

/**
* Main function to run icons action. For slightly more information, see {@link https://miro.com/app/board/uXjVKUMv1ME=/?share_link_id=952145602435 | Miro }
Expand All @@ -41,6 +43,7 @@ export default async function main(
const pngOutputDir = outputDir + pngDir;
const dartOutputDir = outputDir + flutterDir;
const tsOutputDir = outputDir + webDir;
const androidOutputDir = outputDir + androidDir;

const response = await getFigmaDocument(figmaFileId, figmaToken);
console.log("✅ - Fetched figma document");
Expand Down Expand Up @@ -83,6 +86,9 @@ export default async function main(
const generateFontResult = await generateFonts(tempOutputDir, "zeta-icons", dartOutputDir, tsOutputDir);
console.log("✅ - Generated fonts");

generateAndroidIcons(androidOutputDir, manifest);
console.log("✅ - Generated Android icons.");

generateDefinitionFiles(outputDir, generateFontResult, manifest);
console.log("✅ - Generated definition files.");

Expand Down
Loading

0 comments on commit 4154878

Please sign in to comment.