Skip to content

[PLUGINS] Bump Version [openai] #36

[PLUGINS] Bump Version [openai]

[PLUGINS] Bump Version [openai] #36

name: Release templates
on:
push:
branches:
- main
paths: # run this action only when the templates folder is changed
- 'templates/**'
jobs:
release_changed_templates:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get changed files for templates
id: changed-files-specific
uses: tj-actions/changed-files@v44
- name: Filter changed plugins and set output
id: set-matrix
env:
AWS_ACCESS_KEY_ID: ${{ secrets.SUPERDUPER_PUBLIC_TEMPLATES_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.SUPERDUPER_PUBLIC_TEMPLATES_AWS_SECRET_ACCESS_KEY}}
run: |
IFS=$'\n'
changed_files=(${{ steps.changed-files-specific.outputs.all_changed_files }})
declare -A template_set
python3 -m pip install awscli
for file in "${changed_files[@]}"; do
if [[ "$file" =~ ^templates/ ]]; then
template_name=$(echo "$file" | cut -d '/' -f 2)
version=$(cat "templates/$template_name/VERSION")
cd templates/$template_name && zip -r "${template_name}.zip" . && cd ../..
echo "Releasing ${template_name}-${version}.zip !!!"
aws s3 cp "templates/${template_name}/${template_name}.zip" "s3://superduper-public-templates/${template_name}-${version}.zip"
echo "Releasing ${template_name}-${version}.zip !!!... DONE"
fi
done