Push mtzqmmrlmzzx #34
@@ -0,0 +1,32 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ['**']
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: rust:latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: src
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Cache cargo registry
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/registry
|
||||||
|
~/.cargo/git
|
||||||
|
src/target
|
||||||
|
key: ${{ runner.os }}-cargo-${{ hashFiles('src/Cargo.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-cargo-
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: cargo build --release
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: cargo test --release
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-linux-static:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: rust:latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: src
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Cache cargo registry
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/registry
|
||||||
|
~/.cargo/git
|
||||||
|
src/target
|
||||||
|
key: linux-musl-cargo-${{ hashFiles('src/Cargo.lock') }}
|
||||||
|
restore-keys: linux-musl-cargo-
|
||||||
|
|
||||||
|
- name: Install musl toolchain
|
||||||
|
run: |
|
||||||
|
apt-get update -qq && apt-get install -y -qq musl-tools
|
||||||
|
rustup target add x86_64-unknown-linux-musl
|
||||||
|
|
||||||
|
- name: Build static binary
|
||||||
|
run: cargo build --release --target x86_64-unknown-linux-musl
|
||||||
|
|
||||||
|
- name: Prepare artifact
|
||||||
|
run: |
|
||||||
|
mkdir -p /tmp/dist
|
||||||
|
cp target/x86_64-unknown-linux-musl/release/obikmer /tmp/dist/obikmer-linux-x86_64
|
||||||
|
strip /tmp/dist/obikmer-linux-x86_64
|
||||||
|
|
||||||
|
- name: Upload release asset
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: obikmer-linux-x86_64
|
||||||
|
path: /tmp/dist/obikmer-linux-x86_64
|
||||||
|
if-no-files-found: error
|
||||||
@@ -63,3 +63,28 @@ clean-doc:
|
|||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean: clean-doc
|
clean: clean-doc
|
||||||
rm -rf $(VENV)
|
rm -rf $(VENV)
|
||||||
|
|
||||||
|
# ── release ───────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
CARGO_TOML := $(CARGO_DIR)/obikmer/Cargo.toml
|
||||||
|
|
||||||
|
.PHONY: bump-version
|
||||||
|
bump-version:
|
||||||
|
@current=$$(grep '^version = ' $(CARGO_TOML) | head -n 1 | sed 's/version = "\(.*\)"/\1/'); \
|
||||||
|
if [ -n "$(RELEASE)" ]; then \
|
||||||
|
new_version="$(RELEASE)"; \
|
||||||
|
else \
|
||||||
|
major=$$(echo $$current | cut -d. -f1); \
|
||||||
|
minor=$$(echo $$current | cut -d. -f2); \
|
||||||
|
patch=$$(echo $$current | cut -d. -f3); \
|
||||||
|
new_patch=$$((patch + 1)); \
|
||||||
|
new_version="$$major.$$minor.$$new_patch"; \
|
||||||
|
fi; \
|
||||||
|
echo "Version: $$current -> $$new_version"; \
|
||||||
|
sed -i.bak "s/^version = \"$$current\"/version = \"$$new_version\"/" $(CARGO_TOML) && \
|
||||||
|
rm $(CARGO_TOML).bak
|
||||||
|
|
||||||
|
.PHONY: release
|
||||||
|
release: bump-version
|
||||||
|
@jj auto-describe
|
||||||
|
@jj git push --change @
|
||||||
|
|||||||
Generated
+1
-1
@@ -1704,7 +1704,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "obikmer"
|
name = "obikmer"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap",
|
"clap",
|
||||||
"csv",
|
"csv",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "obikmer"
|
name = "obikmer"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ use clap::{Parser, Subcommand};
|
|||||||
use tracing_subscriber::{EnvFilter, fmt};
|
use tracing_subscriber::{EnvFilter, fmt};
|
||||||
|
|
||||||
#[derive(Parser)]
|
#[derive(Parser)]
|
||||||
#[command(name = "obikmer", about = "DNA k-mer tools")]
|
#[command(name = "obikmer", about = "DNA k-mer tools", version)]
|
||||||
struct Cli {
|
struct Cli {
|
||||||
#[command(subcommand)]
|
#[command(subcommand)]
|
||||||
command: Commands,
|
command: Commands,
|
||||||
|
|||||||
Reference in New Issue
Block a user