Skip to content

Commit

Permalink
CI update all kanidm component version and tag
Browse files Browse the repository at this point in the history
Add make entry to have all cargo versions updated from VERSION file.
Add `tag_version` github action to update all cargo.toml and tag it and
push it.
Remove cargo fmt check from CI because we have problems with different
versions and fails continually. Instead, we use cargo-husky to ensure
that all people run it automatically in its local, but this is not
obligatory.
Remove all versions between dependencies in internal packages.

In future cargo will support managing all dependencies from main
Cargo.toml. Ref: rust-lang/cargo#3931

Resolve kanidm#225
  • Loading branch information
pando85 committed May 12, 2020
1 parent 15bc8d4 commit 53296d2
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 24 deletions.
18 changes: 2 additions & 16 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,8 @@ name: Rust
on: [push, pull_request]

jobs:
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1.0.6
with:
toolchain: stable
override: true
components: rustfmt

- name: Run cargo fmt
run: cargo fmt --all -- --check
# TODO clippy


build:
runs-on: ubuntu-latest
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/tag_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: tag and version

on:
push:
branches:
- master

jobs:
update-version:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Commit files
id: commit
run: |
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
if git diff --exit-code $(git describe --tags --abbrev=0 HEAD)..HEAD -- VERSION;
then exit 0;
fi
make update-version
git add .
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
VERSION=$(cat VERSION)
git commit -m "v${VERSION}"
git tag "v${VERSION}"
echo ::set-output name=PUSH::true
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tags: true
if: ${{ steps.commit.outputs.PUSH }}
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,8 @@ install-tools:
prep:
cargo outdated -R
cargo audit

update-version: ## update version form VERSION file in all Cargo.toml manifests
update-version: */Cargo.toml
@VERSION=`cat VERSION`; sed -i "0,/^version\ \= .*$$/{s//version = \"$$VERSION\"/}" */Cargo.toml
@echo updated to version "`cat VERSION`" cargo files
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.0.0-rc10
4 changes: 2 additions & 2 deletions kanidm_client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repository = "https://github.com/kanidm/kanidm/"
log = "0.4"
env_logger = "0.7"
reqwest = { version = "0.10", features=["blocking", "cookies", "json", "native-tls"] }
kanidm_proto = { path = "../kanidm_proto", version = "0.1" }
kanidm_proto = { path = "../kanidm_proto" }
serde = "1.0"
serde_json = "1.0"
serde_derive = "1.0"
Expand All @@ -23,5 +23,5 @@ uuid = { version = "0.8", features = ["serde", "v4"] }
[dev-dependencies]
tokio = "0.2"
actix = "0.9"
kanidm = { path = "../kanidmd", version = "0.1" }
kanidm = { path = "../kanidmd" }
futures = "0.3"
4 changes: 2 additions & 2 deletions kanidm_tools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ name = "kanidm_badlist_preprocess"
path = "src/badlist_preprocess.rs"

[dependencies]
kanidm_client = { path = "../kanidm_client", version = "0.1" }
kanidm_proto = { path = "../kanidm_proto", version = "0.1" }
kanidm_client = { path = "../kanidm_client" }
kanidm_proto = { path = "../kanidm_proto" }
rpassword = "4.0"
structopt = { version = "0.3", default-features = false }
log = "0.4"
Expand Down
6 changes: 3 additions & 3 deletions kanidm_unix_int/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ name = "kanidm_test_auth"
path = "src/test_auth.rs"

[dependencies]
kanidm_client = { path = "../kanidm_client", version = "0.1" }
kanidm_proto = { path = "../kanidm_proto", version = "0.1" }
kanidm_client = { path = "../kanidm_client" }
kanidm_proto = { path = "../kanidm_proto" }
kanidm = { path = "../kanidmd" }
toml = "0.5"
rpassword = "4.0"
Expand Down Expand Up @@ -69,5 +69,5 @@ reqwest = { version = "0.10" }
default = [ "libsqlite3-sys/bundled" ]

[dev-dependencies]
kanidm = { path = "../kanidmd", version = "0.1" }
kanidm = { path = "../kanidmd" }
actix = "0.9"
6 changes: 5 additions & 1 deletion kanidmd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ path = "src/server/main.rs"


[dependencies]
kanidm_proto = { path = "../kanidm_proto", version = "0.1" }
kanidm_proto = { path = "../kanidm_proto" }

actix = "0.9"
actix-web = { version = "2.0", features = ["openssl"] }
Expand Down Expand Up @@ -79,3 +79,7 @@ default = [ "libsqlite3-sys/bundled", "openssl/vendored" ]
[dev-dependencies]
criterion = "0.3"

[dev-dependencies.cargo-husky]
version = "1"
default-features = false # Disable features which are enabled by default
features = ["precommit-hook", "run-cargo-fmt"]

0 comments on commit 53296d2

Please sign in to comment.