Skip to content

Commit 4c9f3eb

Browse files
sthulbdreamorosi
andauthored
chore(docs): publish aliases in versions.json (#1522)
* fix(docs): aliases in versions.json * fix alignment * Update .github/workflows/reusable-publish-docs.yml * Update reusable-publish-docs.yml * change stanza name * remove dupe code * remove dupe code * Update reusable-publish-docs.yml --------- Co-authored-by: Andrea Amorosi <dreamorosi@gmail.com>
1 parent 4f1591d commit 4c9f3eb

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

.github/workflows/reusable-publish-docs.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)