Skip to content

Commit

Permalink
chore(docs): publish aliases in versions.json (#1522)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
sthulb and dreamorosi authored Jun 21, 2023
1 parent 4f1591d commit 4c9f3eb
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/reusable-publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,20 @@ jobs:
env:
VERSION: ${{ inputs.version }}
ALIAS: ${{ inputs.alias }}
# 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.
# Instead, we're using some shell script that manages the versions.
#
# Operations:
# 1. Download the versions.json file from S3
# 2. Find any reference to the alias and delete it from the versions file
# 3. We insert the new version to the versions.json file with the corresponding alias
# 4. Once done, we'll upload it back to S3.
run: |
aws s3 cp \
s3://${{ secrets.AWS_DOCS_BUCKET }}/lambda-typescript/versions.json \
versions_old.json
jq '. += [{"version": "${{ env.VERSION }}", "title": "${{ env.VERSION }}", "aliases": []}]' < versions_old.json > versions.json
jq 'del(.[].aliases[] | select(. == "${{ env.ALIAS }}"))' < versions_old.json > versions_proc.json
jq '. += [{"version": "${{ env.VERSION }}", "title": "${{ env.VERSION }}", "aliases": ["${{ env.ALIAS }}"]}]' < versions_proc.json > versions.json
aws s3 cp \
versions.json \
s3://${{ secrets.AWS_DOCS_BUCKET }}/lambda-typescript/versions.json
s3://${{ secrets.AWS_DOCS_BUCKET }}/lambda-typescript/versions.json

0 comments on commit 4c9f3eb

Please sign in to comment.