mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-25 21:19:35 +01:00
Merge #759
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:
commit
1499a445cd
1 changed files with 25 additions and 5 deletions
30
.github/workflows/build.yml
vendored
30
.github/workflows/build.yml
vendored
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue