Skip to content

Commit

Permalink
CI: Verify semver compatibility when tags is pushed
Browse files Browse the repository at this point in the history
Add a job that checks compatibility when a tag is pushed.
It gets current version from Cargo.toml, calculates previous
version (unless current version is on crates.io - which should not be
the case) and checks that the release type (major / minor / patch) is
correct.
  • Loading branch information
Lorak-mmk committed Jan 28, 2024
1 parent a280843 commit 27eadd5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/semver_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
branches:
- main
- 'branch-*'
push:
tags:
- v*.*.*

env:
CARGO_TERM_COLOR: always
Expand Down Expand Up @@ -79,3 +82,14 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}

semver-push-tag:
runs-on: ubuntu-latest
if: github.event_name == 'push'
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- name: Install semver-checks
run: cargo install cargo-semver-checks --no-default-features
- name: Verify that's it's safe to publish the version.
run: make semver-version

0 comments on commit 27eadd5

Please sign in to comment.