From 278aaa82fc5d807bce5ba5ab73129ca38d37ec48 Mon Sep 17 00:00:00 2001 From: Mahmoud Mazouz Date: Thu, 4 Apr 2024 16:53:56 +0200 Subject: [PATCH] fix: Release workflow --- .github/workflows/pre-release.yml | 15 ++++------- .github/workflows/release.yml | 43 +++++++++++++++++++++---------- 2 files changed, 35 insertions(+), 23 deletions(-) diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 631302d722..2a1f760e26 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -35,10 +35,8 @@ jobs: - name: Clone this repository uses: actions/checkout@v4 - - name: Install Rust toolchain - run: | - rustup show - rustup component add rustfmt clippy + - name: Install rustup components + run: rustup component add rustfmt clippy - name: Code format check run: cargo fmt --check @@ -62,11 +60,8 @@ jobs: - name: Clone this repository uses: actions/checkout@v4 - - name: Install Rust toolchain - run: rustup show - - name: Install nextest - run: cargo install --locked cargo-nextest + run: cargo +stable install --locked cargo-nextest env: CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse @@ -83,7 +78,7 @@ jobs: ASYNC_STD_THREAD_COUNT: 4 doc: - name: Doc generation + name: Generate documentation needs: checks runs-on: ubuntu-latest steps: @@ -94,7 +89,7 @@ jobs: - name: Install Rust toolchain nightly for docs gen run: rustup toolchain install nightly - - name: generate doc + - name: Run rustdoc using Nightly Rust and Zenoh unstable # NOTE: force 'unstable' feature for doc generation, as forced for docs.rs build in zenoh/Cargo.toml run: > cargo +nightly rustdoc --manifest-path ./zenoh/Cargo.toml --lib --features unstable -j3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fe050776ec..38e3a63426 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,24 +20,38 @@ on: inputs: live-run: type: boolean - description: If false (or undefined) the workflow runs in dry-run mode (i.e. with no side-effects) + description: Live-run required: false default: false version: type: string - description: Release number. If undefined, the workflow auto-generates a version using git-describe + description: Release number required: false jobs: tag: - name: Bump and tag crates - uses: eclipse-zenoh/ci/.github/workflows/tag-crates.yml@main - with: - repo: ${{ github.repository }} - live-run: ${{ inputs.live-run || false }} - version: ${{ inputs.version }} - inter-deps-pattern: zenoh.* - secrets: inherit + name: Branch, bump & tag crates + runs-on: ubuntu-latest + outputs: + version: ${{ steps.create-release-branch.outputs.version }} + branch: ${{ steps.create-release-branch.outputs.branch }} + steps: + - id: create-release-branch + uses: eclipse-zenoh/ci/create-release-branch@main + with: + repo: ${{ github.repository }} + live-run: ${{ inputs.live-run || false }} + version: ${{ inputs.version }} + github-token: ${{ secrets.BOT_TOKEN_WORKFLOW }} + + - uses: eclipse-zenoh/ci/bump-crates@main + with: + repo: ${{ github.repository }} + version: ${{ steps.create-release-branch.outputs.version }} + branch: ${{ steps.create-release-branch.outputs.branch }} + bump-deps-pattern: zenoh.* + bump-deps-version: ${{ steps.create-release-branch.outputs.version }} + github-token: ${{ secrets.BOT_TOKEN_WORKFLOW }} build-debian: name: Build Debian packages @@ -64,14 +78,13 @@ jobs: secrets: inherit cargo: - name: Publish Cargo crates needs: tag + name: Publish Cargo crates uses: eclipse-zenoh/ci/.github/workflows/release-crates-cargo.yml@main with: - repos: ${{ github.repository }} + repo: ${{ github.repository }} live-run: ${{ inputs.live-run || false }} branch: ${{ needs.tag.outputs.branch }} - inter-deps-pattern: zenoh.* secrets: inherit debian: @@ -149,6 +162,7 @@ jobs: live-run: ${{ inputs.live-run || false }} version: ${{ needs.tag.outputs.version }} repo: ${{ github.repository }} + branch: ${{ needs.tag.outputs.branch }} tags: "eclipse/zenoh:${{ needs.tag.outputs.version }}" binary: zenohd files: | @@ -158,6 +172,7 @@ jobs: platforms: | linux/arm64 linux/amd64 + licenses: EPL-2.0 OR Apache-2.0 secrets: inherit ghcr: @@ -169,6 +184,7 @@ jobs: live-run: ${{ inputs.live-run || false }} version: ${{ needs.tag.outputs.version }} repo: ${{ github.repository }} + branch: ${{ needs.tag.outputs.branch }} tags: "${{ github.repository }}:${{ needs.tag.outputs.version }}" binary: zenohd files: | @@ -178,4 +194,5 @@ jobs: platforms: | linux/arm64 linux/amd64 + licenses: EPL-2.0 OR Apache-2.0 secrets: inherit