Skip to content

Updated the build CI to create a tag when the version is incremented #9

Updated the build CI to create a tag when the version is incremented

Updated the build CI to create a tag when the version is incremented #9

Workflow file for this run

name: Rust CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Clippy
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
needs: version_change

Check failure on line 38 in .github/workflows/rust-ci.yml

View workflow run for this annotation

GitHub Actions / Rust CI

Invalid workflow file

The workflow is not valid. .github/workflows/rust-ci.yml (Line: 38, Col: 7): Unexpected value 'needs'
if: ${{ needs.version_change.outputs.version_changed == '0' }}
run: |
git tag $current_version
git push --tags