Skip to content

Commit

Permalink
Updated the build CI to create a tag when the version is incremented
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasJowett committed Jun 15, 2023
1 parent 6157b56 commit 7757004
Show file tree
Hide file tree
Showing 2 changed files with 208 additions and 139 deletions.
18 changes: 17 additions & 1 deletion .github/workflows/rust-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Build
run: cargo build --verbose
Expand All @@ -24,4 +26,18 @@ jobs:
run: cargo test --verbose

- name: Clippy
run: cargo clippy --verbose -- -D warnings
run: cargo clippy --verbose -- -D warnings

- name: Determine version change
id: version_change
run: |
previous_version=$(git describe --abbrev=0 --tags || echo "")
current_version=$(awk -F\" '/version/ {print $2}' Cargo.toml")
echo "::set-output name=version_changed::$(test -z "$previous_version" || test "$previous_version" != "$current_version"; echo $?)"
- name: Create release
id: create_release
if: ${{ needs.version_change.outputs.version_changed == '0' }}
run: |
git tag $current_version
git push --tags
Loading

0 comments on commit 7757004

Please sign in to comment.