Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 31 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Extract version (Unix/Win)
id: ver
shell: bash
run: |
VERSION=$(grep '^version' Cargo.toml | head -n1 | cut -d '"' -f2)
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"

- name: Cache cargo / target
uses: actions/cache@v4
with:
Expand All @@ -46,13 +46,20 @@ jobs:
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}

- name: Install Rust target
run: rustup target add ${{ matrix.target }}

- name: Build
run: cargo build --release --target ${{ matrix.target }}


- name: Build (with icon embedding on Windows)
shell: bash
run: |
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
rustup default stable-x86_64-pc-windows-msvc
cargo build --release --target ${{ matrix.target }}
else
cargo build --release --target ${{ matrix.target }}
fi

- name: Package
shell: bash
run: |
Expand All @@ -69,7 +76,7 @@ jobs:
tar -czf librius-${VERSION}-${{ matrix.target }}.tar.gz librius-${{ matrix.target }}
cp librius-${VERSION}-${{ matrix.target }}.tar.gz $GITHUB_WORKSPACE/release_artifacts/${{ matrix.target }}/
fi

- name: Upload artifact (lnx/win)
uses: actions/upload-artifact@v4
with:
Expand All @@ -84,15 +91,15 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Extract version
id: ver
shell: bash
run: |
VERSION=$(grep '^version' Cargo.toml | head -n1 | cut -d '"' -f2)
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"

- name: Cache cargo / target
uses: actions/cache@v4
with:
Expand All @@ -101,15 +108,15 @@ jobs:
~/.cargo/git
target
key: macos-cargo-dual-${{ hashFiles('**/Cargo.lock') }}

- name: Install Rust targets (x86_64 + aarch64)
run: |
rustup target add x86_64-apple-darwin
rustup target add aarch64-apple-darwin

- name: Build x86_64
run: cargo build --release --target x86_64-apple-darwin

- name: Package x86_64
shell: bash
run: |
Expand All @@ -120,10 +127,10 @@ jobs:
cp $GITHUB_WORKSPACE/{README.md,LICENSE,CHANGELOG.md} librius-x86_64-apple-darwin/
tar -czf librius-${VERSION}-x86_64-apple-darwin.tar.gz librius-x86_64-apple-darwin
cp librius-${VERSION}-x86_64-apple-darwin.tar.gz $GITHUB_WORKSPACE/release_artifacts/x86_64-apple-darwin/

- name: Build aarch64
run: cargo build --release --target aarch64-apple-darwin

- name: Package aarch64
shell: bash
run: |
Expand All @@ -134,7 +141,7 @@ jobs:
cp $GITHUB_WORKSPACE/{README.md,LICENSE,CHANGELOG.md} librius-aarch64-apple-darwin/
tar -czf librius-${VERSION}-aarch64-apple-darwin.tar.gz librius-aarch64-apple-darwin
cp librius-${VERSION}-aarch64-apple-darwin.tar.gz $GITHUB_WORKSPACE/release_artifacts/aarch64-apple-darwin/

- name: Upload artifacts (macOS)
uses: actions/upload-artifact@v4
with:
Expand All @@ -154,13 +161,13 @@ jobs:
pattern: release_artifacts-*
path: temp_download
merge-multiple: true

- name: Combine into single folder
shell: bash
run: |
mkdir -p release_artifacts
find temp_download -type f -exec cp {} release_artifacts/ \;

- name: Upload consolidated
uses: actions/upload-artifact@v4
with:
Expand All @@ -174,20 +181,20 @@ jobs:
steps:
- name: Checkout (for Cargo.toml/CHANGELOG)
uses: actions/checkout@v4

- name: Download consolidated
uses: actions/download-artifact@v4
with:
name: release_artifacts
path: release_artifacts

- name: Extract version
id: extract_version
run: |
VERSION=$(grep '^version' Cargo.toml | head -n1 | cut -d '"' -f2)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "VERSION=$VERSION" >> $GITHUB_ENV

- name: Generate SHA256 for all files
shell: bash
run: |
Expand All @@ -197,7 +204,7 @@ jobs:
[[ -f "$f" ]] || continue
sha256sum "$f" > "$f.sha256" || shasum -a 256 "$f" > "$f.sha256"
done

- name: Import GPG key
shell: bash
run: |
Expand All @@ -207,7 +214,7 @@ jobs:
echo "$GPG_PRIVATE_KEY" | base64 --decode | gpg --batch --import
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}

- name: Sign all artifacts (detach .sig)
shell: bash
run: |
Expand All @@ -220,7 +227,7 @@ jobs:
done
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
Expand Down
39 changes: 39 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# ================================================================
# Git Submodules configuration for Librius
# ================================================================
# This file defines the external Git repositories ("submodules")
# that are linked inside this project.
#
# Submodules are used to include external or private components
# (e.g. developer scripts, shared configs, documentation assets)
# without merging their contents directly into the main repo.
# ================================================================

# ------------------------------------------------
# Private developer utilities (not public)
# ------------------------------------------------
# Path: tools_private/
# Repository: github.com/umpire274/librius-dev-scripts.git
# Access: private (owner/collaborators only)
# ------------------------------------------------
[submodule "tools_private"]
path = tools_private
url = git@github.com:umpire274/rust_dev_scripts.git

# ================================================================
# Tips:
# - Clone with submodules:
# git clone --recurse-submodules git@github.com:umpire274/librius.git
#
# - If you already cloned:
# git submodule update --init --recursive
#
# - Update the submodule (inside main repo):
# cd tools_private && git pull origin main && cd ..
# git add tools_private
# git commit -m "Update private scripts submodule"
#
# - If you move the submodule folder:
# git mv old_path new_path
# and update the 'path' entry here accordingly.
# ================================================================
72 changes: 71 additions & 1 deletion Cargo.lock

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

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "librius"
version = "0.4.0"
version = "0.4.1"
edition = "2024"
authors = ["Alessandro Maestri <umpire274@gmail.com>"]
description = "A personal library manager CLI written in Rust."
Expand Down Expand Up @@ -52,5 +52,8 @@ zip = "6.0.0"
flate2 = "1.1.4"
tar = "0.4.44"

[build-dependencies]
winresource = "0.1.23"

[profile.release]
opt-level = 3
Loading