File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -130,11 +130,20 @@ jobs:
130130 env :
131131 VERSION : ${{ inputs.version }}
132132 ALIAS : ${{ inputs.alias }}
133+ # We originally used "mike" from PyPi to manage versions for us, but since we moved to S3, we can't use it to manage versions any more.
134+ # Instead, we're using some shell script that manages the versions.
135+ #
136+ # Operations:
137+ # 1. Download the versions.json file from S3
138+ # 2. Find any reference to the alias and delete it from the versions file
139+ # 3. We insert the new version to the versions.json file with the corresponding alias
140+ # 4. Once done, we'll upload it back to S3.
133141 run : |
134142 aws s3 cp \
135143 s3://${{ secrets.AWS_DOCS_BUCKET }}/lambda-typescript/versions.json \
136144 versions_old.json
137- jq '. += [{"version": "${{ env.VERSION }}", "title": "${{ env.VERSION }}", "aliases": []}]' < versions_old.json > versions.json
145+ jq 'del(.[].aliases[] | select(. == "${{ env.ALIAS }}"))' < versions_old.json > versions_proc.json
146+ jq '. += [{"version": "${{ env.VERSION }}", "title": "${{ env.VERSION }}", "aliases": ["${{ env.ALIAS }}"]}]' < versions_proc.json > versions.json
138147 aws s3 cp \
139148 versions.json \
140- s3://${{ secrets.AWS_DOCS_BUCKET }}/lambda-typescript/versions.json
149+ s3://${{ secrets.AWS_DOCS_BUCKET }}/lambda-typescript/versions.json
You can’t perform that action at this time.
0 commit comments