@@ -401,7 +401,14 @@ jobs:
401401
402402 pushd $src
403403 rm -f .cargo/config
404- cargo doc || cargo doc --features timer-queue
404+ # Version 1 and below uses cargo doc directly
405+ if [[ $ver -gt 1 ]]
406+ then
407+ # Version 2 and above
408+ cargo xtask doc
409+ else
410+ cargo doc || cargo doc --features timer-queue
411+ fi
405412 mkdir -p $webroot/$ver/book
406413 cp -r target/doc $webroot/$ver/api
407414
@@ -433,18 +440,23 @@ jobs:
433440 parseversion :
434441 name : Parse the master branch RTIC version
435442 runs-on : ubuntu-22.04
443+ outputs :
444+ branch : ${{ steps.parseversion.outputs.branch }}
445+ versionmajor : ${{ steps.parseversion.outputs.versionmajor }}
446+ version : ${{ steps.parseversion.outputs.version }}
436447 steps :
437448 - uses : actions/checkout@v3
438449
439450 - name : Get crate version and print output branch release/vX
440- id : crateversionbranch
451+ id : parseversion
441452 # Parse metadata for version number, extract the Semver Major
442453 run : |
443454 VERSION=$(cargo metadata --format-version 1 --no-deps --offline | jq -r '.packages[] | select(.name =="rtic") | .version')
444455 VERSIONMAJOR=${VERSION%.*.*}
445- echo "branch=release/v$VERSIONMAJOR" >> $GITHUB_ENV
446- echo "versionmajor=$VERSIONMAJOR" >> $GITHUB_ENV
447- echo "version=$VERSION" >> $GITHUB_ENV
456+ echo "branch=release/v$VERSIONMAJOR" >> "$GITHUB_OUTPUT"
457+ echo "versionmajor=$VERSIONMAJOR" >> "$GITHUB_OUTPUT"
458+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"
459+
448460
449461
450462 # Update stable branch
@@ -462,6 +474,10 @@ jobs:
462474 needs :
463475 - ci-success
464476 - parseversion
477+ env :
478+ branch : ${{ needs.parseversion.outputs.branch }}
479+ majorversion : ${{ needs.parseversion.outputs.majorversion }}
480+ version : ${{ needs.parseversion.outputs.version }}
465481
466482 # Only run this when pushing to master branch
467483 if : github.ref == 'refs/heads/master'
@@ -472,6 +488,10 @@ jobs:
472488 if : ${{ env.versionmajor == env.STABLE_VERSION }}
473489 run : git push -u origin ${{ env.branch }}
474490
491+ - name : Else case, master did not contain the stable version version
492+ if : ${{ env.versionmajor != env.STABLE_VERSION }}
493+ run : echo "Master branch contains a development release, no git push performed"
494+
475495 # Only runs when pushing to master branch
476496 # Bors run CI against staging branch,
477497 # if that succeeds Borst tries against master branch
0 commit comments