-
Notifications
You must be signed in to change notification settings - Fork 48
156 lines (143 loc) · 5.17 KB
/
submit-plugin.yml
File metadata and controls
156 lines (143 loc) · 5.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
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
workflow_call:
inputs:
plugin_path:
description: 'Plugin directory relative to repo root (e.g., "plugins/csv-import" or ".")'
required: true
type: string
changelog:
description: 'Changelog text (mutually exclusive with pr_body)'
required: false
type: string
pr_body:
description: 'Full PR body — changelog will be extracted (mutually exclusive with changelog)'
required: false
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
PLUGIN_BUILD_SECRETS:
description: 'Newline-separated KEY=VALUE pairs to set as env vars during build'
required: false
jobs:
submit:
name: Submit Plugin to Marketplace
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
steps:
# Checkout the caller's repo (plugin source + git history for tags)
- name: Checkout plugin source
uses: actions/checkout@v4
with:
fetch-depth: 0
path: source
# Checkout the plugins repo (scripts + tooling).
# For workflow_dispatch this is redundant (same repo), but keeps the flow uniform.
# When triggered manually, use the selected branch; for workflow_call, use default branch.
- name: Checkout tooling
uses: actions/checkout@v4
with:
repository: framer/plugins
ref: ${{ github.event_name == 'workflow_dispatch' && github.ref || '' }}
path: tooling
- name: Configure git identity
working-directory: source
run: |
git config user.email "marketplace@framer.team"
git config user.name "Framer Marketplace"
- name: Validate plugin path
working-directory: source
run: |
if [ ! -d "${{ inputs.plugin_path }}" ]; then
echo "Error: Plugin path '${{ inputs.plugin_path }}' does not exist"
echo ""
echo "Available contents:"
ls -1
exit 1
fi
if [ ! -f "${{ 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: tooling/.tool-versions
- name: Install tooling dependencies
working-directory: tooling
run: yarn install
- name: Install source plugin dependencies
working-directory: source
run: yarn install
- name: Build framer-plugin-tools
working-directory: tooling
run: yarn turbo run build --filter=framer-plugin-tools
- name: Set plugin build environment
run: echo "${{ secrets.PLUGIN_BUILD_SECRETS }}" >> "$GITHUB_ENV"
- name: Submit plugin
working-directory: tooling
run: yarn tsx scripts/submit-plugin.ts
env:
PLUGIN_PATH: ${{ github.workspace }}/source/${{ inputs.plugin_path }}
REPO_ROOT: ${{ github.workspace }}/source
CHANGELOG: ${{ inputs.changelog }}
PR_BODY: ${{ inputs.pr_body }}
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 }}