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

feat: add github action to publish workflow ui files #1027

Merged
merged 9 commits into from
Nov 18, 2022

Conversation

estephinson
Copy link
Contributor

@estephinson estephinson commented Nov 17, 2022

Add GitHub action to copy workflow-ui.json from supporting packages on changes to plugins.json

@netlify
Copy link

netlify bot commented Nov 17, 2022

Deploy Preview for netlify-plugins ready!

Name Link
🔨 Latest commit 3b0ebbb
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugins/deploys/637653c28297e000095cb7e4
😎 Deploy Preview https://deploy-preview-1027--netlify-plugins.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@estephinson estephinson linked an issue Nov 17, 2022 that may be closed by this pull request
@estephinson estephinson marked this pull request as ready for review November 17, 2022 15:45
@estephinson estephinson requested a review from a team November 17, 2022 15:46
echo "Installing $PACKAGE"
# remove the quotes from the package name
PACKAGE=$(echo $PACKAGE | tr -d '"')
npm install $PACKAGE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to install the package vs pulling the file directly from NPM?

We only need raw files, not to pull dependencies and such

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, will use https://unpkg.com

Copy link
Contributor

@sean-roberts sean-roberts Nov 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

example being

npm pack $PACKAGE
tar -xf *.tgz

now a package directory will be there with the file contents

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suppose we'll need the whole package for the dynamic scripts and such

This is what I was using currently but I'll use npm pack instead

curl -s https://unpkg.com/$PACKAGE@latest/workflow-ui.json -o site/$PACKAGE/workflow-ui.json || true

npm install $PACKAGE
if [ -f "node_modules/$PACKAGE/workflow-ui.json" ]; then
echo "Copying workflow-ui.json from $PACKAGE"
cp node_modules/$PACKAGE/workflow-ui.json site/$PACKAGE/workflow-ui.json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not blocking but

if you change this to site/workflow-ui/package/$PACKAGE/workflow-ui.json it would already accomplish the package endpoint

Copy link
Contributor

@sean-roberts sean-roberts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code is looking solid!
Approving in case you want to address the npm install vs pack logic in a future PR

@kodiakhq kodiakhq bot merged commit 9eea77d into main Nov 18, 2022
@kodiakhq kodiakhq bot deleted the ejs/publish-workflow-ui branch November 18, 2022 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build step for exposing configuration
2 participants