diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5cb794b111..fc0c8d236f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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