-
Notifications
You must be signed in to change notification settings - Fork 34
Integrating Figma code connect + mapping first 10 components #2369
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
base: main
Are you sure you want to change the base?
Changes from all commits
c5a047b
c8f647c
3efed85
de1316f
947015e
83b4e5d
7bd7a63
cdfd4b8
db367e4
e2a976c
3e0f565
d7dc382
30bf96e
1e19046
8f69aff
aee01c4
3cdd55d
e6d8ae2
f863118
78e1494
4a60a41
b5280a3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,9 +2,16 @@ name: Build | |
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| figma_enabled: | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
| secrets: | ||
| GH_APP_PRIVATE_KEY: | ||
| required: true | ||
| FIGMA_ACCESS_TOKEN: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Has this been added to the secrets? Who owns it?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. its in the backpack android Github secretes yes
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes but whose figma account generated it? |
||
| required: false | ||
|
|
||
|
|
||
| defaults: | ||
|
|
@@ -105,6 +112,32 @@ jobs: | |
| - name: Unit Tests | ||
| run: ./gradlew test${{ env.flavour }}${{ env.config }}UnitTest -PdisablePreDex | ||
|
|
||
| - name: Check for Code Connect changes | ||
| id: code-connect-filter | ||
| if: ${{ inputs.figma_enabled }} | ||
| uses: dorny/paths-filter@v3 | ||
| with: | ||
| token: ${{ steps.app-token.outputs.token }} | ||
| filters: | | ||
| code_connect: | ||
| - 'app/src/main/java/net/skyscanner/backpack/demo/figma/**' | ||
| - 'figma.config.json' | ||
|
|
||
| - name: Install Figma Code Connect | ||
| if: ${{ inputs.figma_enabled && steps.code-connect-filter.outputs.code_connect == 'true' }} | ||
| continue-on-error: true | ||
| run: npm install -g @figma/[email protected] | ||
|
|
||
| - name: Validate Code Connect files | ||
| if: ${{ inputs.figma_enabled && steps.code-connect-filter.outputs.code_connect == 'true' }} | ||
| continue-on-error: true | ||
| run: | | ||
| echo "🔍 Found Code Connect files, validating..." | ||
| npx figma connect parse | ||
| npx figma connect publish --dry-run | ||
| env: | ||
| FIGMA_ACCESS_TOKEN: ${{ secrets.FIGMA_ACCESS_TOKEN }} | ||
|
|
||
| Android: | ||
| name: Android tests | ||
| runs-on: ubuntu-24.04-16cores-public | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,8 +20,11 @@ jobs: | |
| pull-requests: write | ||
| contents: write | ||
| uses: ./.github/workflows/_build.yml | ||
| with: | ||
| figma_enabled: true | ||
| secrets: | ||
| GH_APP_PRIVATE_KEY: ${{ secrets.GH_APP_PRIVATE_KEY }} | ||
| FIGMA_ACCESS_TOKEN: ${{ secrets.FIGMA_ACCESS_TOKEN }} | ||
|
|
||
| Deploy: | ||
| name: Deploy | ||
|
|
@@ -81,6 +84,38 @@ jobs: | |
| - name: Update Supernova docs | ||
| run: npx @supernovaio/cli publish-documentation --apiKey=${{ secrets.SUPERNOVA_API_KEY }} --designSystemId=${{ secrets.SUPERNOVA_DESIGN_SYSTEM_ID }} | ||
|
|
||
| - name: Check for Code Connect changes | ||
| id: code-connect-filter | ||
| run: | | ||
| # Get the previous tag | ||
| PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "") | ||
| if [ -z "$PREVIOUS_TAG" ]; then | ||
| echo "No previous tag found, will publish Code Connect" | ||
| echo "code_connect_changed=true" >> $GITHUB_OUTPUT | ||
| else | ||
| # Check if any Code Connect files changed since the previous tag | ||
| CHANGED=$(git diff --name-only $PREVIOUS_TAG HEAD -- 'app/src/main/java/net/skyscanner/backpack/demo/figma/' 'figma.config.json' | wc -l) | ||
| if [ "$CHANGED" -gt 0 ]; then | ||
| echo "Code Connect files changed since $PREVIOUS_TAG" | ||
| echo "code_connect_changed=true" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "No Code Connect files changed since $PREVIOUS_TAG" | ||
| echo "code_connect_changed=false" >> $GITHUB_OUTPUT | ||
| fi | ||
| fi | ||
|
|
||
| - name: Install Figma Code Connect | ||
| if: steps.code-connect-filter.outputs.code_connect_changed == 'true' | ||
| continue-on-error: true | ||
| run: npm install -g @figma/[email protected] | ||
|
|
||
| - name: Publish Code Connect to Figma | ||
| if: steps.code-connect-filter.outputs.code_connect_changed == 'true' | ||
| continue-on-error: true | ||
| run: npx figma connect publish --exit-on-unreadable-files | ||
| env: | ||
| FIGMA_ACCESS_TOKEN: ${{ secrets.FIGMA_ACCESS_TOKEN }} | ||
|
|
||
| - name: Publish release to Runway | ||
| run: | | ||
| set -e | ||
|
|
@@ -89,3 +124,4 @@ jobs: | |
| RUNWAY_API_KEY: ${{ secrets.RUNWAY_API_KEY }} | ||
| RUNWAY_APP_ID: ${{ secrets.RUNWAY_APP_ID }} | ||
| RUNWAY_BUCKET_ID: ${{ secrets.RUNWAY_BUCKET_ID }} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
those compostables are place holders to display snippet code in figma
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compost😆