-
Notifications
You must be signed in to change notification settings - Fork 47
Add CI for submitting plugins to Marketplace on merge #548
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
74c4608
0d055c8
899dcd8
6d1ae45
159b380
8b8ac04
60ebe0a
aa0858c
6eda437
d47d7f8
a34ee36
b821688
8d9af20
89a006b
2cd2f4c
336c728
5a483cd
6a25207
3b45d10
6eb1f74
4733542
5092fa7
7083487
d19f10d
b27028e
c9a9123
994c09a
0acf723
21b5802
7dd77d4
43b2d21
999cafa
7e2bedc
d28c187
e789f38
3d1d28e
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 |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| name: Submit on Merge | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: | ||
| - closed | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| submit: | ||
| name: Submit Changed Plugins | ||
| runs-on: ubuntu-latest | ||
| # Only run if PR was merged (not just closed) and has "Submit on merge" label | ||
| if: | | ||
| github.event.pull_request.merged == true && | ||
| contains(github.event.pull_request.labels.*.name, 'Submit on merge') | ||
| # FIXME: Should be production | ||
| environment: development | ||
|
Member
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. note to self to fix before merging. 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. Development environment hardcoded instead of productionHigh Severity The workflow has Additional Locations (1) |
||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 # Full history for git tags and diff | ||
|
|
||
| - name: Configure git identity | ||
| run: | | ||
| git config --global user.email "marketplace@framer.team" | ||
| git config --global user.name "Framer Marketplace" | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version-file: .tool-versions | ||
|
|
||
| - name: Install dependencies | ||
| run: yarn install | ||
|
|
||
| - name: Build framer-plugin-tools | ||
| working-directory: packages/plugin-tools | ||
| run: yarn build | ||
|
|
||
| - name: Write PR body to file | ||
| run: cat <<< "$PR_BODY" > /tmp/pr-body.txt | ||
| env: | ||
| PR_BODY: ${{ github.event.pull_request.body }} | ||
|
|
||
| - name: Submit changed plugins | ||
| run: | | ||
| export CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}) | ||
| yarn tsx scripts/submit-on-merge.ts | ||
| env: | ||
| DEBUG: "1" | ||
| PR_BODY_FILE: /tmp/pr-body.txt | ||
| SESSION_TOKEN: ${{ secrets.SESSION_TOKEN }} | ||
| FRAMER_ADMIN_SECRET: ${{ secrets.FRAMER_ADMIN_SECRET }} | ||
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
| SLACK_ERROR_WEBHOOK_URL: ${{ secrets.SLACK_ERROR_WEBHOOK_URL }} | ||
| RETOOL_URL: ${{ secrets.RETOOL_URL }} | ||
| # FIXME: Should be production | ||
| FRAMER_ENV: development | ||
|
Member
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. should fix |
||
| GITHUB_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| name: Submit Plugin | ||
|
|
||
| on: | ||
| # Manual trigger from GitHub UI | ||
| workflow_dispatch: | ||
| inputs: | ||
| plugin_path: | ||
| description: 'Plugin directory (e.g., plugins/csv-import)' | ||
| required: true | ||
| type: string | ||
| changelog: | ||
| description: 'Changelog for this release' | ||
| required: true | ||
| type: string | ||
| environment: | ||
| description: 'Environment (development/production)' | ||
| required: true | ||
| default: 'development' | ||
| type: choice | ||
| options: | ||
| - development | ||
| - production | ||
| dry_run: | ||
| description: 'Dry run (skip submission and tagging)' | ||
| required: false | ||
| default: false | ||
| type: boolean | ||
|
|
||
| # Reusable workflow - can be called from other repos (e.g., framer/workshop) | ||
| workflow_call: | ||
| inputs: | ||
| plugin_path: | ||
| description: 'Plugin directory (e.g., plugins/csv-import)' | ||
| required: true | ||
| type: string | ||
| changelog: | ||
| description: 'Changelog for this release' | ||
| required: true | ||
| type: string | ||
| environment: | ||
| description: 'Environment (development/production)' | ||
| required: true | ||
| default: 'development' | ||
| type: string | ||
| dry_run: | ||
| description: 'Dry run (skip submission and tagging)' | ||
| required: false | ||
| default: false | ||
| type: boolean | ||
| secrets: | ||
| SESSION_TOKEN: | ||
| description: 'Framer session cookie' | ||
| required: true | ||
| FRAMER_ADMIN_SECRET: | ||
| description: 'Framer admin API key' | ||
| required: true | ||
| SLACK_WEBHOOK_URL: | ||
| description: 'Slack webhook URL for notifications' | ||
| required: false | ||
| RETOOL_URL: | ||
| description: 'Retool dashboard URL for Slack notifications' | ||
| required: false | ||
| SLACK_ERROR_WEBHOOK_URL: | ||
| description: 'Slack webhook URL for error notifications' | ||
| required: false | ||
|
|
||
| jobs: | ||
| submit: | ||
| name: Submit Plugin to Marketplace | ||
| runs-on: ubuntu-latest | ||
| environment: ${{ inputs.environment }} | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 # Full history for git tags and diff | ||
|
|
||
| - name: Configure git identity | ||
| run: | | ||
| git config --global user.email "marketplace@framer.team" | ||
| git config --global user.name "Framer Marketplace" | ||
| - name: Validate plugin path | ||
| run: | | ||
| if [ ! -d "${{ github.workspace }}/${{ inputs.plugin_path }}" ]; then | ||
| echo "Error: Plugin path '${{ inputs.plugin_path }}' does not exist" | ||
| echo "" | ||
| echo "Available plugins:" | ||
| ls -1 plugins/ | ||
| exit 1 | ||
| fi | ||
| if [ ! -f "${{ github.workspace }}/${{ inputs.plugin_path }}/framer.json" ]; then | ||
| echo "Error: No framer.json found in '${{ inputs.plugin_path }}'" | ||
| exit 1 | ||
| fi | ||
| echo "Plugin path validated: ${{ inputs.plugin_path }}" | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version-file: .tool-versions | ||
|
|
||
| - name: Install dependencies | ||
| run: yarn install | ||
|
|
||
| - name: Build framer-plugin-tools | ||
| run: yarn turbo run build --filter=framer-plugin-tools | ||
|
|
||
| - name: Submit plugin | ||
| run: yarn tsx scripts/submit-plugin.ts | ||
|
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.
For Useful? React with 👍 / 👎.
Member
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. Will focus on cross repo invoking in follow up but good call |
||
| env: | ||
| PLUGIN_PATH: ${{ github.workspace }}/${{ inputs.plugin_path }} | ||
| REPO_ROOT: ${{ github.workspace }} | ||
| CHANGELOG: ${{ inputs.changelog }} | ||
| SESSION_TOKEN: ${{ secrets.SESSION_TOKEN }} | ||
| FRAMER_ADMIN_SECRET: ${{ secrets.FRAMER_ADMIN_SECRET }} | ||
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
| SLACK_ERROR_WEBHOOK_URL: ${{ secrets.SLACK_ERROR_WEBHOOK_URL }} | ||
| RETOOL_URL: ${{ secrets.RETOOL_URL }} | ||
| FRAMER_ENV: ${{ inputs.environment }} | ||
| GITHUB_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
| DRY_RUN: ${{ inputs.dry_run }} | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Framer Code Link CLI | ||
|
|
||
| Two-way syncing Framer of code components between Framer and your computer. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| { | ||
| "name": "framer-code-link", | ||
| "version": "0.7.0", | ||
| "description": "CLI tool for syncing Framer code components - controller-centric architecture", | ||
| "main": "dist/index.mjs", | ||
| "type": "module", | ||
| "bin": "./dist/index.mjs", | ||
| "files": [ | ||
| "dist" | ||
| ], | ||
| "scripts": { | ||
| "dev": "NODE_ENV=development tsx src/index.ts", | ||
| "build": "tsdown", | ||
| "start": "node dist/index.mjs", | ||
| "test": "vitest run" | ||
| }, | ||
| "keywords": [ | ||
| "framer", | ||
| "sync", | ||
| "code-components" | ||
| ], | ||
| "author": "", | ||
| "license": "MIT", | ||
| "dependencies": { | ||
| "@typescript/ata": "^0.9.8", | ||
| "chokidar": "^5.0.0", | ||
| "commander": "^14.0.3", | ||
| "prettier": "^3.7.4", | ||
| "typescript": "^5.9.3", | ||
| "ws": "^8.18.3" | ||
| }, | ||
| "devDependencies": { | ||
| "@code-link/shared": "workspace:*", | ||
| "@types/node": "^22.19.2", | ||
| "@types/ws": "^8.18.1", | ||
| "tsdown": "^0.20.1", | ||
| "tsx": "^4.21.0", | ||
| "vitest": "^4.0.15" | ||
| } | ||
| } |


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.
Sparse checkout missing required .tool-versions file
High Severity
The sparse checkout configuration does not include
.tool-versions, but theSetup Node.jsstep on line 51 requires this file vianode-version-file: .tool-versions. The workflow will fail because the file won't exist after the sparse checkout completes.