Skip to content

Commit

Permalink
chore: publish templates with -version qualifier
Browse files Browse the repository at this point in the history
  • Loading branch information
nikku committed Oct 13, 2022
1 parent a699845 commit cc24910
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/RELEASE.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ jobs:
git tag -a "${tag}" -m "${message}"
git push origin "${tag}"
- name: Install element template bundling dependencies
run: sudo apt install jq

- name: Bundle element templates
run: ./bundle-templates.sh ${RELEASE_VERSION}
env:
Expand Down
19 changes: 19 additions & 0 deletions bundle-templates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,25 @@ https://github.com/camunda/connector-slack/releases/download/${SLACK_VERSION}/sl
https://github.com/camunda/connector-sqs/releases/download/${SQS_VERSION}/aws-sqs-connector.json
EOF

tag_version() {
local file=$1
local version=$(cat $file | jq '. | if type == "array" then .[0] else . end | .version')

local base_name="${file%%".json"*}"

if [[ "null" != "$version" ]]; then
echo "tag_version: Renaming $file -> $base_name-$version.json"

mv "$file" "$base_name-$version.json"
else
echo "tag_version: Keeping $file (unversioned)"
fi
}

for file in *.json; do
tag_version $file
done

tar czvf ${ARTIFACT_DIR}/connectors-bundle-templates-${RELEASE_VERSION}.tar.gz *.json
zip ${ARTIFACT_DIR}/connectors-bundle-templates-${RELEASE_VERSION}.zip *.json

Expand Down

0 comments on commit cc24910

Please sign in to comment.