Skip to content

Commit

Permalink
Mark stable tags from default branch as latest
Browse files Browse the repository at this point in the history
Do not mark stable tags from release or maintenance branches as latest.
  • Loading branch information
rustydb committed Nov 7, 2024
1 parent aa8a7ee commit a39d408
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/promote-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
workflow_dispatch:
env:
STREAM: stable
LATEST: false
jobs:
Promote:
runs-on: ubuntu-latest
Expand All @@ -24,13 +25,26 @@ jobs:
with:
STREAM: ${{ env.STREAM }}

- name: Get Branch
run: |
mapfile -t branches < <(git branch -r --contains ${{ github.ref }} | awk '{print $1}')
echo "${branches[@]}"
for branch in "${branches[@]}"; do
branch_name="${branch/origin\/}"
echo "${branch_name}"
if [ "${branch_name}" = 'main' ]; then
echo LATEST=true >> $GITHUB_ENV
break
fi
done
- uses: ncipollo/release-action@v1
with:
allowUpdates: true # if the job is re-ran to catch missed artifacts, allow updates
generateReleaseNotes: true
artifacts: ${{ env.DIR_UPLOAD }}/*
prerelease: false
makeLatest: true
makeLatest: ${{ fromJSON(env.LATEST) }}

generate_publish_docs:
name: generate docs with nox/sphinx and publish with mike
Expand Down

0 comments on commit a39d408

Please sign in to comment.