diff --git a/.github/verify_version.sh b/.github/verify_version.sh new file mode 100755 index 0000000..7524635 --- /dev/null +++ b/.github/verify_version.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +set -e + +QBITTORRENT_WEB_API_VERSION="$(cat Cargo.toml | grep version | head -1 | sed 's/version = //' | sed 's/"//g')" +QBITTORRENT_WEB_API_GEN_VERSION="$(cat qbittorrent-web-api-gen/Cargo.toml | grep version | head -1 | sed 's/version = //' | sed 's/"//g')" + +if [ $QBITTORRENT_WEB_API_VERSION != $QBITTORRENT_WEB_API_GEN_VERSION ] +then + printf "Version mismatch, QBITTORRENT_WEB_API_VERSION=${QBITTORRENT_WEB_API_VERSION} and QBITTORRENT_WEB_API_GEN_VERSION=${QBITTORRENT_WEB_API_GEN_VERSION} (they must match)" >&2 + exit 1 +fi diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f341c51..97a4586 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,11 +7,17 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 + + - name: Verify version + run: ./.github/verify_version.sh + - name: Install latest stable uses: actions-rs/toolchain@v1 with: toolchain: stable + - name: Extract + - name: Login uses: actions-rs/cargo@v1 with: @@ -29,8 +35,4 @@ jobs: with: command: publish - # - name: Publish qbittorrent-web-api - # uses: actions-rs/cargo@v1 - # with: - # command: publish \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 879a9ad..71f8de0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -545,7 +545,7 @@ dependencies = [ [[package]] name = "qbittorrent-web-api" -version = "0.1.0" +version = "0.2.0" dependencies = [ "qbittorrent-web-api-gen", "reqwest", diff --git a/Cargo.toml b/Cargo.toml index 097b668..f311298 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "qbittorrent-web-api" -version = "0.1.0" +version = "0.2.0" edition = "2021" license-file = "LICENSE" keywords = ["qbittorrent"]