ci: make release checks for breaking changes run package dependent

Signed-off-by: simonsan <14062932+simonsan@users.noreply.github.com>
This commit is contained in:
simonsan 2023-09-14 16:02:32 +02:00
parent 49465a7107
commit 99759eb4ff
No known key found for this signature in database
GPG Key ID: E11D13668EC3B71B
4 changed files with 38 additions and 6 deletions

View File

@ -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 }}

View File

@ -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 }}

View File

@ -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 }}

View File

@ -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 }}