759: ci/releasetuning r=korken89 a=AfoHT

- CI: Cargo doc for both pre and post v2
- CI: Make it clearer why a branch push was omitted
- ci: Use job outputs


Co-authored-by: Henrik Tjäder <henrik@tjaders.com>
This commit is contained in:
bors[bot] 2023-05-31 20:22:31 +00:00 committed by GitHub
commit 1499a445cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -401,7 +401,14 @@ jobs:
pushd $src
rm -f .cargo/config
cargo doc || cargo doc --features timer-queue
# Version 1 and below uses cargo doc directly
if [[ $ver -gt 1 ]]
then
# Version 2 and above
cargo xtask doc
else
cargo doc || cargo doc --features timer-queue
fi
mkdir -p $webroot/$ver/book
cp -r target/doc $webroot/$ver/api
@ -433,18 +440,23 @@ jobs:
parseversion:
name: Parse the master branch RTIC version
runs-on: ubuntu-22.04
outputs:
branch: ${{ steps.parseversion.outputs.branch }}
versionmajor: ${{ steps.parseversion.outputs.versionmajor }}
version: ${{ steps.parseversion.outputs.version }}
steps:
- uses: actions/checkout@v3
- name: Get crate version and print output branch release/vX
id: crateversionbranch
id: parseversion
# Parse metadata for version number, extract the Semver Major
run: |
VERSION=$(cargo metadata --format-version 1 --no-deps --offline | jq -r '.packages[] | select(.name =="rtic") | .version')
VERSIONMAJOR=${VERSION%.*.*}
echo "branch=release/v$VERSIONMAJOR" >> $GITHUB_ENV
echo "versionmajor=$VERSIONMAJOR" >> $GITHUB_ENV
echo "version=$VERSION" >> $GITHUB_ENV
echo "branch=release/v$VERSIONMAJOR" >> "$GITHUB_OUTPUT"
echo "versionmajor=$VERSIONMAJOR" >> "$GITHUB_OUTPUT"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
# Update stable branch
@ -462,6 +474,10 @@ jobs:
needs:
- ci-success
- parseversion
env:
branch: ${{ needs.parseversion.outputs.branch }}
majorversion: ${{ needs.parseversion.outputs.majorversion }}
version: ${{ needs.parseversion.outputs.version }}
# Only run this when pushing to master branch
if: github.ref == 'refs/heads/master'
@ -472,6 +488,10 @@ jobs:
if: ${{ env.versionmajor == env.STABLE_VERSION }}
run: git push -u origin ${{ env.branch }}
- name: Else case, master did not contain the stable version version
if: ${{ env.versionmajor != env.STABLE_VERSION }}
run: echo "Master branch contains a development release, no git push performed"
# Only runs when pushing to master branch
# Bors run CI against staging branch,
# if that succeeds Borst tries against master branch