diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 0ae03e7..c3ab592 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -16,8 +16,18 @@ jobs: with: tool: cargo-release@0.24 - uses: taiki-e/install-action@cargo-make - - name: login - run: cargo login "$CARGO_AUTH_KEY" + - name: Get version + run: | + POSITIONAL_VERSION=$(grep -m1 '^version' positional/Cargo.toml | cut -d'"' -f2) + POSITIONAL_DERIVE_VERSION=$(grep -m1 '^version' positional_derive/Cargo.toml | cut -d'"' -f2) + echo "POSITIONAL_VERSION=$POSITIONAL_VERSION" >> $GITHUB_ENV + echo "POSITIONAL_DERIVE_VERSION=$POSITIONAL_DERIVE_VERSION" >> $GITHUB_ENV + - name: Check version + if: ${{ github.event.release.tag_name != env.POSITIONAL_VERSION || github.event.release.tag_name != env.POSITIONAL_DERIVE_VERSION }} + run: | + echo "Github ref tag [${{ github.event.release.tag_name }}] is different from positional Cargo.toml version [${{ env.POSITIONAL_VERSION }}] or positional_derive Cargo.toml version [${{ env.POSITIONAL_DERIVE_VERSION }}]" + exit 1 + - run: cargo login "$CARGO_AUTH_KEY" env: CARGO_AUTH_KEY: ${{ secrets.CARGO_AUTH_KEY }} - run: cargo make release diff --git a/positional/Cargo.toml b/positional/Cargo.toml index 69364ad..60ce22b 100644 --- a/positional/Cargo.toml +++ b/positional/Cargo.toml @@ -5,7 +5,7 @@ license = "MIT" name = "positional" readme = "../README.md" repository = "https://github.com/primait/positional.rs" -version = "0.4.1" +version = "0.4.1-rc.0" [[bench]] harness = false diff --git a/positional_derive/Cargo.toml b/positional_derive/Cargo.toml index bf26224..8791f1e 100644 --- a/positional_derive/Cargo.toml +++ b/positional_derive/Cargo.toml @@ -3,7 +3,7 @@ description = "Macros for positional crate" edition = "2021" license = "MIT" name = "positional_derive" -version = "0.4.1" +version = "0.4.1-rc.0" documentation = "https://docs.rs/positional" [lib]