Add version verification

This commit is contained in:
Joel Wachsler 2022-07-10 18:09:08 +00:00
parent 690cc5e1e6
commit 26143ad733
4 changed files with 20 additions and 6 deletions

12
.github/verify_version.sh vendored Executable file
View File

@ -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

View File

@ -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

2
Cargo.lock generated
View File

@ -545,7 +545,7 @@ dependencies = [
[[package]]
name = "qbittorrent-web-api"
version = "0.1.0"
version = "0.2.0"
dependencies = [
"qbittorrent-web-api-gen",
"reqwest",

View File

@ -1,6 +1,6 @@
[package]
name = "qbittorrent-web-api"
version = "0.1.0"
version = "0.2.0"
edition = "2021"
license-file = "LICENSE"
keywords = ["qbittorrent"]