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: Created script to generate Android icons #38

Merged
merged 2 commits into from
Oct 18, 2024
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
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