diff options
author | 2023-05-31 20:22:31 +0000 | |
---|---|---|
committer | 2023-05-31 20:22:31 +0000 | |
commit | 1499a445cda37427e8f817ff9a05c1154d1861ff (patch) | |
tree | b8397be7ad28b588e71add5a6b14423cadd05224 | |
parent | 781ed8a9cdbb72ab639e73f52219b7d96fa6ec86 (diff) | |
parent | 371f6253227bb3c95dc43ae8aaa697ecd51be596 (diff) | |
download | rtic-1499a445cda37427e8f817ff9a05c1154d1861ff.tar.gz rtic-1499a445cda37427e8f817ff9a05c1154d1861ff.tar.zst rtic-1499a445cda37427e8f817ff9a05c1154d1861ff.zip |
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>
-rw-r--r-- | .github/workflows/build.yml | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5cb794b1..fc0c8d23 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 |