Skip to content

Commit

Permalink
add simple release management with cargo-release
Browse files Browse the repository at this point in the history
Added a `[release]` section to the Cargo.toml file to establish a common standard for managing release settings. This new addition incorporates settings for generating changelogs, signing commits, and updating dependencies. This will ensure a more streamlined and uniform release procedure. It also corrects the script to conform to the targeted behavior when releasing alpha versions.
  • Loading branch information
keinsell committed Jan 4, 2025
1 parent 35e34ee commit 06fca42
Show file tree
Hide file tree
Showing 6 changed files with 353 additions and 39 deletions.
36 changes: 34 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: main

on:
pull_request:
Expand Down Expand Up @@ -27,6 +27,16 @@ on:
- prereleased

jobs:
cargo_lint:
name: "lint"
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
target: x86_64-unknown-linux-gnu
override: true
cargo_build:
runs-on: ${{ matrix.os }}
strategy:
Expand Down Expand Up @@ -59,4 +69,26 @@ jobs:
name: neuronek-cli-${{ matrix.target }}
path: |
target/${{ matrix.target }}/release/neuronek-cli
target/${{ matrix.target }}/release/neuronek-cli.exe
target/${{ matrix.target }}/release/neuronek-cli.exe
# Disabled until automatic versioning will be configured
# cargo_release:
# name: "release"
# runs-on: "ubuntu-latest"
# steps:
# - uses: actions/checkout@v3
# - uses: actions-rs/toolchain@v1
# with:
# toolchain: nightly
# target: "x86_64-unknown-linux-gnu"
# override: true
# - name: Install cargo plugins
# run: >
# cargo install cargo-quickinstall
# cargo-quickinstall cargo-release
#
# - name: Run cargo-release
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: cargo release alpha
26 changes: 26 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: publish

on:
workflow_dispatch:
release:
types:
- created

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly

- name: Install and run cargo-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cargo install cargo-release
cargo release alpha --execute --no-confirm
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# Note that the GitHub Release will be created with a generated
# title/body based on your changelogs.

name: Release
name: release
permissions:
"contents": "write"

Expand Down
75 changes: 41 additions & 34 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ cargo-features = ["edition2024"]
name = "neuronek"
description = "🧬 Intelligent dosage tracker application for monitoring supplements, nootropics and psychoactive substances along with their long-term influence on one's mind and body."
authors = ["Jakub Olan <[email protected]>"]
version = "0.0.0-dev.6"
version = "0.0.0"
edition = "2024"
repository = "https://github.com/keinsell/neuronek"
license-file = "LICENSE"

[[bin]]
name = "neuronek"
Expand All @@ -19,52 +20,58 @@ license = false
eula = false

[dependencies]
assert_cmd = "2.0.16"
async-std = { version = "1", features = ["attributes", "async-global-executor"] }
directories = { version = "5.0.1" }
clap = { version = "4.5.23", features = ["derive", "wrap_help", "suggestions", "std", "usage", "error-context", "help", "unstable-styles", "unicode", "env", "unstable-v5"] }
miette = { version = "7.4.0", features = ["fancy", "serde", "syntect-highlighter", "derive"] }
sea-orm = { version = "1.1.2", features = ["sqlx-sqlite", "runtime-async-std-rustls", "serde_json", "with-chrono"] }
serde = { version = "1.0.216", features = ["derive", "std", "unstable"] }
lazy_static = "1.5.0"
figlet-rs = "0.1.5"
serde_json = "1.0.133"
atty = "0.2.14"
chrono = { version = "0.4.39", features = ["std", "serde", "iana-time-zone", "rkyv"] }
log = { version = "0.4.22", features = ["serde", "kv", "max_level_trace", "release_max_level_off"] }
measurements = { version = "0.11.0", features = ["std", "serde", "from_str", "regex"] }
pubchem = "0.1.1"
tabled = { version = "0.17.0", features = ["std", "macros", "ansi", "derive", "tabled_derive"] }
rust-embed = "8.5.0"
assert_cmd = "2.0.16"
logforth = "0.19.0"
typed-builder = "0.20.0"
date_time_parser = "0.2.0"
chrono-english = "0.1.7"
clap = { version = "4.5.23", features = ["derive", "wrap_help", "suggestions", "std", "usage", "error-context", "help", "unstable-styles", "unicode", "env", "unstable-v5"] }
clap-verbosity-flag = "3.0.1"
clap_complete = "4.5.40"
atty = "0.2.14"
ryu = "1.0.18"
float-pretty-print = "0.1.1"
colored = "2.2.0"
date_time_parser = "0.2.0"
delegate = "0.13.1"
derivative = "2.2.0"
directories = { version = "5.0.1" }
figlet-rs = "0.1.5"
float-pretty-print = "0.1.1"
futures = "0.3.31"
hashbrown = "0.15.2"
iso8601-duration = "0.2.0"
ptree = "0.5.2"
indicatif = { version = "0.17.9", features = ["rayon", "futures"] }
futures = "0.3.31"
colored = "2.2.0"
[dependencies.sea-orm-migration]
version = "1.1.0"
features = [
lazy_static = "1.5.0"
log = { version = "0.4.22", features = ["serde", "kv", "max_level_trace", "release_max_level_off"] }
logforth = "0.19.0"
measurements = { version = "0.11.0", features = ["std", "serde", "from_str", "regex"] }
miette = { version = "7.4.0", features = ["fancy", "serde", "syntect-highlighter", "derive"] }
pubchem = "0.1.1"
rust-embed = "8.5.0"
sea-orm = { version = "1.1.2", features = ["sqlx-sqlite", "runtime-async-std-rustls", "serde_json", "with-chrono"] }
serde = { version = "1.0.216", features = ["derive", "std", "unstable"] }
tabled = { version = "0.17.0", features = ["std", "macros", "ansi", "derive", "tabled_derive"] }
typed-builder = "0.20.0"
sea-orm-migration = { version = "1.1.0", features = [
"runtime-async-std-rustls",
"sqlx-sqlite"
]
serde_json = { version = "1" }
futures = { version = "0.3" }
] }
serde_json = "1.0.134"
async-stream = { version = "0.3" }
futures-util = { version = "0.3" }
clap = { version = "4" }
directories = { version = "5.0.0" }
atty = "0.2"

[release]
allow-branch = ["trunk"]
default-level = "alpha"
update-dependencies = true
changelog = true
tag-annotate = true
pre-release-commit-message = "{{crate_name}}@{{version}}"
push-remote = "origin"
sign-commit = false
sign-tag = false
no-confirm = true

[expand]
color = "always"
pager = true

[profile.dist]
inherits = "release"
Expand Down
Loading

0 comments on commit 06fca42

Please sign in to comment.