From 99759eb4ffa804596bc762afd3e17df65ef4e697 Mon Sep 17 00:00:00 2001 From: simonsan <14062932+simonsan@users.noreply.github.com> Date: Thu, 14 Sep 2023 16:02:32 +0200 Subject: [PATCH] ci: make release checks for breaking changes run package dependent Signed-off-by: simonsan <14062932+simonsan@users.noreply.github.com> --- .github/workflows/nightly.yml | 2 +- .github/workflows/prebuilt-pr.yml | 2 +- .github/workflows/release-cd.yml | 2 +- .github/workflows/release-ci.yml | 38 ++++++++++++++++++++++++++++--- 4 files changed, 38 insertions(+), 6 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 0a147bf..b40aec7 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -86,7 +86,7 @@ jobs: with: fetch-depth: 0 # fetch all history so that git describe works - name: Create binary artifact - uses: rustic-rs/create-binary-artifact@main # dev + uses: rustic-rs/create-binary-artifact-action@main # dev with: toolchain: ${{ matrix.rust }} target: ${{ matrix.job.target }} diff --git a/.github/workflows/prebuilt-pr.yml b/.github/workflows/prebuilt-pr.yml index 7dd8f7c..7f0dc9f 100644 --- a/.github/workflows/prebuilt-pr.yml +++ b/.github/workflows/prebuilt-pr.yml @@ -83,7 +83,7 @@ jobs: with: fetch-depth: 0 # fetch all history so that git describe works - name: Create binary artifact - uses: rustic-rs/create-binary-artifact@main # dev + uses: rustic-rs/create-binary-artifact-action@main # dev with: toolchain: ${{ matrix.rust }} target: ${{ matrix.job.target }} diff --git a/.github/workflows/release-cd.yml b/.github/workflows/release-cd.yml index 7ea5356..cdc0570 100644 --- a/.github/workflows/release-cd.yml +++ b/.github/workflows/release-cd.yml @@ -77,7 +77,7 @@ jobs: with: fetch-depth: 0 # fetch all history so that git describe works - name: Create binary artifact - uses: rustic-rs/create-binary-artifact@main # dev + uses: rustic-rs/create-binary-artifact-action@main # dev with: toolchain: ${{ matrix.rust }} target: ${{ matrix.job.target }} diff --git a/.github/workflows/release-ci.yml b/.github/workflows/release-ci.yml index da2c3f8..127335d 100644 --- a/.github/workflows/release-ci.yml +++ b/.github/workflows/release-ci.yml @@ -4,11 +4,39 @@ on: push: branches: - release/* + # TODO!: We might want to do it manually? Not sure. + # workflow_dispatch: + # inputs: + # crate: + # description: Crate to release + # required: true + # type: choice + # options: + # - rustic + # - rustic_core + # - rustic_testing jobs: + determine-package: + name: Determine package to release + runs-on: ubuntu-latest + outputs: + package: ${{ steps.determine-package-name.outputs.package }} + steps: + - name: Determine package + id: determine-package-name + run: | + if [[ ${{ github.ref }} == 'refs/releases/rustic_core-*' ]]; then + echo "package=rustic_core" >> $GITHUB_OUTPUT + elif [[ ${{ github.ref }} == 'refs/releases/rustic-*' ]]; then + echo "package=rustic" >> $GITHUB_OUTPUT + fi + breaking-cli: name: Check breaking CLI changes runs-on: ${{ matrix.job.os }} + needs: determine-package + if: ${{ needs.determine-package.outputs.package }} == 'rustic' strategy: matrix: rust: [stable] @@ -27,18 +55,19 @@ jobs: - uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1 with: command: test - args: -r --all-targets --all-features --workspace -- --ignored + args: -r --all-targets --all-features --workspace -p ${{ needs.determine-package.outputs.package }} -- --ignored semver-check: name: Check SemVer runs-on: ubuntu-latest + needs: determine-package strategy: matrix: rust: [stable] job: - os: ubuntu-latest - - os: windows-latest - - os: macos-latest + # - os: windows-latest # Panics + # - os: macos-latest # Panics steps: - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1 @@ -47,5 +76,8 @@ jobs: toolchain: stable override: true - uses: Swatinem/rust-cache@e207df5d269b42b69c8bc5101da26f7d31feddb4 # v2 + - name: Check semver uses: obi1kenobi/cargo-semver-checks-action@e275dda72e250d4df5b564e969e1348d67fefa52 # v2 + with: + package: ${{ needs.determine-package.outputs.package }}