Skip to content
Merged
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
27768fe
initial commit of publish components action
jsendo Jan 6, 2021
1fabc4a
.
jsendo Jan 6, 2021
222cb68
added some test files, updated action to check changes files to see if
jsendo Jan 6, 2021
2f5047b
install pd
jsendo Jan 6, 2021
85acee4
secret
jsendo Jan 6, 2021
af37e09
get pd api key to publish step
jsendo Jan 6, 2021
becc062
.
jsendo Jan 6, 2021
119c767
env
jsendo Jan 6, 2021
5e388f7
trying to get pd to work
jsendo Jan 6, 2021
58c2bd4
pd
jsendo Jan 6, 2021
c7cc053
fix config pathing
jsendo Jan 6, 2021
c4bbc38
cat
jsendo Jan 6, 2021
68acace
list components
jsendo Jan 6, 2021
d8a2f3a
.wq
jsendo Jan 6, 2021
4bebe9f
more pd
jsendo Jan 6, 2021
abcdaaa
force run
jsendo Jan 6, 2021
347017f
trying to get the steps to work together
jsendo Jan 6, 2021
b3fadfd
fix syntax errors
jsendo Jan 6, 2021
691e39e
rearrange steps, clean up api key
jsendo Jan 6, 2021
0fff764
fix file
jsendo Jan 6, 2021
77fcebb
jq?
jsendo Jan 7, 2021
3e2036a
trying to parse jq
jsendo Jan 7, 2021
7b777cb
oops
jsendo Jan 7, 2021
e65cd20
publish test
jsendo Jan 7, 2021
fbae39b
fix jq call
jsendo Jan 7, 2021
9b0cb77
attempt to curl to add to registrywq
jsendo Jan 7, 2021
7f062d3
cleaning up
jsendo Jan 7, 2021
6806d76
removing test stuff
jsendo Jan 7, 2021
cb8f6e7
add publish on push to master (#1)
jsendo Jan 7, 2021
5f9b542
Revert "removing test stuff"
jsendo Jan 8, 2021
041c835
split up pd and jq to do some error checking
jsendo Jan 8, 2021
11e8b24
split up pd and jq calls to do some error checking
jsendo Jan 8, 2021
6776178
error handling hacking
jsendo Jan 8, 2021
add39fc
error handling
jsendo Jan 8, 2021
3310fb5
trying to disable fast fail shell
jsendo Jan 8, 2021
65e751c
break out curl for error handling
jsendo Jan 8, 2021
fb10e51
Merge remote-tracking branch 'origin/master' into publish-test
jsendo Jan 8, 2021
5b025d5
Merge branch 'master' of github.com:PipedreamHQ/pipedream into publis…
jsendo Jan 11, 2021
6941957
remove these files from master pr
jsendo Jan 11, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 24 additions & 5 deletions .github/workflows/publish-components.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
on:
push:
branches:
- master
- publish-test

jobs:
publish-components:
Expand All @@ -26,21 +26,40 @@ jobs:
- name: Publish and add to registry components/*.js (that aren't .app.js files)
env:
PD_API_KEY: ${{ secrets.PD_API_KEY }}
shell: bash {0} # don't fast fail
run: |
UNPUBLISHED=()
mapfile -d ',' -t added_modified_files < <(printf '%s,' '${{ steps.files.outputs.added_modified }}')
for added_modified_file in "${added_modified_files[@]}"; do
# starts with components, ends with .js and not app.js
if [[ $added_modified_file == components/* ]] && [[ $added_modified_file == *.js ]] && [[ $added_modified_file != *.app.js ]]
then
echo "attempting to publish ${added_modified_file}"
KEY=`./pd publish ${added_modified_file} --json | jq -r ".key"`
echo "published ${KEY}"
echo "${KEY} will be added to the registry"
curl "https://api.pipedream.com/graphql" -H "Content-Type: application/json" -H "Authorization: Bearer ${PD_API_KEY}" --data-binary $'{"query":"mutation($key: String\u0021, $registry: Boolean\u0021){\\n setComponentRegistry(key: $key, registry: $registry){\\n savedComponent{\\n id\\n key\\n }\\n }\\n}","variables":{"key":"'${KEY}'","registry":'true'}}'
PD_OUTPUT=`./pd publish ${added_modified_file} --json`
if [ $? -eq 0 ]
then
echo $PD_OUTPUT
KEY=`echo $PD_OUTPUT | jq -r ".key"`
echo $KEY
echo "published ${KEY}"
echo "${KEY} will be added to the registry"
CURL_OUTPUT=`curl "https://api.pipedream.com/graphql" -H "Content-Type: application/json" -H "Authorization: Bearer ${PD_API_KEY}" --data-binary $'{"query":"mutation($key: String\u0021, $registry: Boolean\u0021){\\n setComponentRegistry(key: $key, registry: $registry){\\n savedComponent{\\n id\\n key\\n }\\n }\\n}","variables":{"key":"'${KEY}'","registry":'true'}}'`
echo $CURL_OUTPUT
else
ERROR=`echo $PD_OUTPUT | jq -r ".error"`
echo "there was an error: ${ERROR} with ${added_modified_file}"
UNPUBLISHED+=${added_modified_file}
# add to array to spit out later
fi
else
echo "${added_modified_file} will not be added to the registry"
fi
done
# print out everything that didn't publish
if [ ${#UNPUBLISHED[@]} -ne 0 ]; then
echo "the following files were not published"
printf '%s\n' "${UNPUBLISHED[@]}"
fi
- name: Remove pd cli config
run: |
rm $HOME/.config/pipedream/config