@@ -23,32 +23,24 @@ jobs:
2323 git config --global user.name "GitHub Actions"
2424 git config --global user.email "[email protected] " 2525
26- - name : Check if this is the latest release
26+ - name : Get the latest tag
2727 run : |
28- LATEST_TAG=$(
29- curl -L \
30- -H "Accept: application/vnd.github+json" \
31- -H "Authorization: Bearer ${{ github.token }}" \
32- -H "X-GitHub-Api-Version: 2022-11-28" \
33- https://api.github.com/repos/${{ github.repository }}/releases/latest \
34- | jq -r '.tag_name'
35- )
36- IS_LATEST=${{ env.LATEST_TAG == github.event.release.tag_name }}
37- echo This release is: "${{ github.event.release.tag_name }}"
38- echo The latest release is: "$LATEST_TAG"
39- echo "IS_LATEST_RELEASE=$IS_LATEST" >> "$GITHUB_ENV"
28+ git fetch --tags
29+ latest_tag=$(git tag -l | sort -V | grep -v "rc" | tail -n 1)
30+ echo "latest tag: $latest_tag"
31+ echo "LATEST_TAG=$latest_tag" >> $GITHUB_ENV
4032
4133 - name : Install docs dependencies
4234 working-directory : doc-site
4335 run : pip install -r requirements.txt
4436
4537 - name : Update doc site for release
46- if : ${{ github.event_name == 'release ' && env.IS_LATEST_RELEASE != 'true' }}
38+ if : github.event.action == 'released ' && github.ref_name != env.LATEST_TAG
4739 working-directory : doc-site
4840 run : mike deploy ${{ github.event.release.tag_name }} --push
4941
5042 - name : Update doc site for latest release
51- if : ${{ github.event_name == 'release ' && env.IS_LATEST_RELEASE == 'true' }}
43+ if : github.event.action == 'released ' && github.ref_name == env.LATEST_TAG
5244 working-directory : doc-site
5345 run : mike deploy ${{ github.event.release.tag_name }} latest -u --push
5446
0 commit comments