From f56112b688052800880c3aaa796cdbc306ad90bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Wed, 31 May 2023 21:21:29 +0200 Subject: [PATCH 1/4] CI: Cargo doc for both pre and post v2 --- .github/workflows/build.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5cb794b111..719f84b618 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 From 392795ebe0aff76bdf2d715e9a6e5f7375235e3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Wed, 31 May 2023 21:22:03 +0200 Subject: [PATCH 2/4] CI: Make it clearer why a branch push was omitted --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 719f84b618..d7a0fc3668 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -479,6 +479,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 From aa7d7fd052b54bdee9ab8d056d65402b596d378b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Wed, 31 May 2023 21:53:36 +0200 Subject: [PATCH 3/4] ci: Use job outputs --- .github/workflows/build.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d7a0fc3668..52e0a1de45 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -440,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 @@ -473,6 +478,11 @@ jobs: # Only run this when pushing to master branch if: github.ref == 'refs/heads/master' steps: + - env: + branch: ${{ needs.parseversion.outputs.branch }} + majorversion: ${{ needs.parseversion.outputs.majorversion }} + version: ${{ needs.parseversion.outputs.version }} + - uses: actions/checkout@v3 - name: Push to stable release branch if master contains stable version From 371f6253227bb3c95dc43ae8aaa697ecd51be596 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Wed, 31 May 2023 22:15:39 +0200 Subject: [PATCH 4/4] ci: Move env to job context --- .github/workflows/build.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 52e0a1de45..fc0c8d236f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -474,15 +474,14 @@ 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' steps: - - env: - branch: ${{ needs.parseversion.outputs.branch }} - majorversion: ${{ needs.parseversion.outputs.majorversion }} - version: ${{ needs.parseversion.outputs.version }} - - uses: actions/checkout@v3 - name: Push to stable release branch if master contains stable version