From b30cdeb0fb81fbecae73a09612d404a58300ff4f Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Wed, 17 Jan 2024 01:14:49 +0100 Subject: [PATCH] auto publish on push to master only publish in master this time it will work fix publish ci .gitea/workflows/cargo-publish.yaml aktualisiert .gitea/workflows/cargo-publish.yaml aktualisiert this time for real regular CI on push to not master CI move token around this time for real ci for sure this time ci is so great bump version --- .gitea/workflows/cargo-publish.yaml | 36 ++++++++++++++++++++------ .gitea/workflows/cargo.yaml | 40 +++++++++++++++++++---------- Cargo.toml | 18 +++++++------ members/libpt-bin/Cargo.toml | 9 ++++++- members/libpt-bintols/Cargo.toml | 4 +-- members/libpt-ccc/Cargo.toml | 6 ++--- members/libpt-core/Cargo.toml | 2 +- members/libpt-hedu/Cargo.toml | 4 +-- members/libpt-net/Cargo.toml | 6 ++--- 9 files changed, 84 insertions(+), 41 deletions(-) diff --git a/.gitea/workflows/cargo-publish.yaml b/.gitea/workflows/cargo-publish.yaml index 0e067b2..56ac3b3 100644 --- a/.gitea/workflows/cargo-publish.yaml +++ b/.gitea/workflows/cargo-publish.yaml @@ -12,11 +12,31 @@ jobs: # added or changed files to the repository. contents: write steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - run: cargo check --all-features --all-targets - - run: rustup component add rustfmt - - run: cargo fix --all-features --all-targets - - run: cargo fmt --all - - run: cargo test --all-features --all-targets - - run: cargo publish --index "https://git.cscherr.de/PlexSheep/_cargo-index.git --dry-run + - name: get repo + uses: actions/checkout@v4 + - name: install rust + uses: dtolnay/rust-toolchain@stable + - name: config custom registry + run: | + mkdir -p ~/.cargo/ + echo -e '[registry] + cscherr= "cscherr" + + [registries.cscherr] + index = "sparse+https://git.cscherr.de/api/packages/PlexSheep/cargo/" + ' > ~/.cargo/config.toml + cat ~/.cargo/config.toml + - name: awful hack + env: + - CSCHERR_CARGO_TOKEN: "Bearer ${{ secrets.CARGO_REGISTRY_TOKEN_CSCHERRDE }}" + run: echo $CSCHERR_CARGO_TOKEN + - name: publish crates on git.cscherr.de + env: + - CSCHERR_CARGO_TOKEN: "Bearer ${{ secrets.CARGO_REGISTRY_TOKEN_CSCHERRDE }}" + uses: katyo/publish-crates@v2 + run: echo $CSCHERR_CARGO_TOKEN + with: + args: --registry cscherr --token=$CSCHERR_CARGO_TOKEN + #- uses: katyo/publish-crates@v2 + # with: + # args: --token ${{ secrets.CARGO_REGISTRY_TOKEN_CRATESIO }} diff --git a/.gitea/workflows/cargo.yaml b/.gitea/workflows/cargo.yaml index bd59079..7212c2b 100644 --- a/.gitea/workflows/cargo.yaml +++ b/.gitea/workflows/cargo.yaml @@ -2,7 +2,8 @@ name: Cargo Check, Format, Fix and Test on: push: branches: - - devel + - '**' + - '!master' jobs: format: @@ -12,19 +13,32 @@ jobs: # added or changed files to the repository. contents: write steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - run: cargo check --all-features --all-targets - - run: rustup component add rustfmt - - run: cargo fix --all-features --all-targets - - run: cargo fmt --all - - run: cargo test --all-features --all-targets - - uses: stefanzweifel/git-auto-commit-action@v5 + - name: get repo + uses: actions/checkout@v4 + - name: install rust + uses: dtolnay/rust-toolchain@stable + run: rustup component add rustfmt + - name: config custom registry + run: | + mkdir -p ~/.cargo/ + echo -e '[registry] + cscherr= "cscherr" + + [registries.cscherr] + index = "sparse+https://git.cscherr.de/api/packages/PlexSheep/cargo/" + ' > ~/.cargo/config.toml + cat ~/.cargo/config.toml + - name: cargo check + run: cargo check --all-features --all-targets + - name: cargo fix + run: cargo fix --all-features --all-targets + - name: cargo fmt + run: cargo fmt --all + - name: cargo test + run: cargo test --all-features --all-targets + - name: commit back to repository + uses: stefanzweifel/git-auto-commit-action@v5 with: # Optional. Commit message for the created commit. # Defaults to "Apply automatic changes" commit_message: automatic cargo CI changes - commit_user_name: Gitea CI - commit_user_email: noreply@cscherr.de - commit_author: Gitea CI - diff --git a/Cargo.toml b/Cargo.toml index 4f081b9..3cb3dd1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ members = [ default-members = [".", "members/libpt-bin", "members/libpt-core"] [workspace.package] publish = true -version = "0.2.4" +version = "0.2.5" edition = "2021" authors = ["Christoph J. Scherr "] license = "MIT" @@ -31,6 +31,8 @@ categories = [ [workspace.dependencies] anyhow = "1.0.79" thiserror = "1.0.56" +libpt-log = { version = "0.2.5", path = "../libpt-log" } +libpt-bintols = { version = "0.2.5", ath = "../libpt-bintols" } [package] name = "libpt" @@ -69,10 +71,10 @@ crate-type = [ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -libpt-bintols = { path = "members/libpt-bintols" } -libpt-core = { path = "members/libpt-core" } -libpt-hedu = { path = "members/libpt-hedu" } -libpt-log = { path = "members/libpt-log" } -libpt-math = { path = "members/libpt-math" } -libpt-ccc = { path = "members/libpt-ccc" } -libpt-net = { path = "members/libpt-net" } +libpt-bintols = { version = "0.2.5", path = "members/libpt-bintols" } +libpt-core = { version = "0.2.5", path = "members/libpt-core" } +libpt-hedu = { version = "0.2.5", path = "members/libpt-hedu" } +libpt-log = { version = "0.2.5", path = "members/libpt-log" } +libpt-math = { version = "0.2.5", path = "members/libpt-math" } +libpt-ccc = { version = "0.2.5", path = "members/libpt-ccc" } +libpt-net = { version = "0.2.5", path = "members/libpt-net" } diff --git a/members/libpt-bin/Cargo.toml b/members/libpt-bin/Cargo.toml index 8e926af..3fe1250 100644 --- a/members/libpt-bin/Cargo.toml +++ b/members/libpt-bin/Cargo.toml @@ -31,4 +31,11 @@ path = "src/main/mod.rs" clap = { version = "4.4.4", features = ["derive"] } clap-num = "1.0.2" clap-verbosity-flag = "2.0.1" -libpt = {path = "../..", features = ["default", "ccc", "math", "hedu", "net", "log"] } +libpt = { version = "0.2.3", path = "../..", features = [ + "default", + "ccc", + "math", + "hedu", + "net", + "log", +] } diff --git a/members/libpt-bintols/Cargo.toml b/members/libpt-bintols/Cargo.toml index edcad06..2630dcc 100644 --- a/members/libpt-bintols/Cargo.toml +++ b/members/libpt-bintols/Cargo.toml @@ -16,5 +16,5 @@ categories.workspace = true [dependencies] num-traits = "0.2.16" -libpt-core = { path = "../libpt-core" } -libpt-log = { path = "../libpt-log" } +libpt-core = { version = "0.2.3", path = "../libpt-core" } +libpt-log = { version = "0.2.3", path = "../libpt-log" } diff --git a/members/libpt-ccc/Cargo.toml b/members/libpt-ccc/Cargo.toml index 2487526..d01ab79 100644 --- a/members/libpt-ccc/Cargo.toml +++ b/members/libpt-ccc/Cargo.toml @@ -17,6 +17,6 @@ categories.workspace = true [dependencies] num = "0.4.1" num-traits = "0.2.16" -libpt-core = { path = "../libpt-core" } -libpt-log = { path = "../libpt-log" } -libpt-math = { path = "../libpt-math" } +libpt-core = { version = "0.2.3", path = "../libpt-core" } +libpt-log = { version = "0.2.3", path = "../libpt-log" } +libpt-math = { version = "0.2.3", path = "../libpt-math" } diff --git a/members/libpt-core/Cargo.toml b/members/libpt-core/Cargo.toml index 769f494..2df126e 100644 --- a/members/libpt-core/Cargo.toml +++ b/members/libpt-core/Cargo.toml @@ -15,4 +15,4 @@ categories.workspace = true [dependencies] anyhow = "1.0.79" cucumber = "0.20.2" -libpt-log = {path = "../libpt-log" } +libpt-log = { version = "0.2.3", path = "../libpt-log" } diff --git a/members/libpt-hedu/Cargo.toml b/members/libpt-hedu/Cargo.toml index 4bfcad2..5eb4434 100644 --- a/members/libpt-hedu/Cargo.toml +++ b/members/libpt-hedu/Cargo.toml @@ -17,5 +17,5 @@ categories.workspace = true [dependencies] anyhow = { workspace = true } thiserror = { workspace = true } -libpt-log = {path = "../libpt-log" } -libpt-bintols = {path = "../libpt-bintols" } +libpt-log = { version = "0.2.3", path = "../libpt-log" } +libpt-bintols = { version = "0.2.3", path = "../libpt-bintols" } diff --git a/members/libpt-net/Cargo.toml b/members/libpt-net/Cargo.toml index a840069..1f70680 100644 --- a/members/libpt-net/Cargo.toml +++ b/members/libpt-net/Cargo.toml @@ -16,9 +16,9 @@ categories.workspace = true [dependencies] humantime = "2.1.0" -libpt-core = { path = "../libpt-core" } -libpt-log = { path = "../libpt-log" } -libpt-math = { path = "../libpt-math" } +libpt-core = { version = "0.2.3", path = "../libpt-core" } +libpt-log = { version = "0.2.3", path = "../libpt-log" } +libpt-math = { version = "0.2.3", path = "../libpt-math" } reqwest = { version = "0.11.20", features = ["blocking"] } serde = { version = "1.0.188", features = ["serde_derive"] } serde_json = "1.0.107"