-
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
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 | ||
niekert marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 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 }} | ||


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.