Prepare 0.5.2 (#203) #8
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: test_tag | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
check_tag_match_cargo: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout project | |
uses: actions/checkout@v4 | |
- name: Install tools | |
run: sudo apt install jq | |
- name: Crate Cargo Version | |
run: | | |
cargo metadata --format-version=1 --no-deps | jq -r '.packages[0].version' | |
cargo metadata --format-version=1 --no-deps | jq -r '.packages[0].version' > cargo_version.txt | |
- name: GitHub Tag Name | |
run: | | |
echo "Tag name from GITHUB_REF_NAME: $GITHUB_REF_NAME" | |
echo "Tag name from github.ref_name: ${{ github.ref_name }}" | |
- name: Compare tag name and cargo version | |
run: | | |
tag_name=$(echo "${GITHUB_REF_NAME}" | cut -d '/' -f 3) | |
cargo_version=$(cat cargo_version.txt) | |
if [[ "$tag_name" != "$cargo_version" ]]; then | |
echo "Tag name ($tag_name) does not match cargo version ($cargo_version)" | |
exit 1 | |
fi |