Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency updates and minor changes #54

Merged
merged 3 commits into from
Jan 13, 2025
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
43 changes: 43 additions & 0 deletions .github/scripts/package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/usr/bin/env bash
set -eu

# Slightly tweaked from https://github.com/EmbarkStudios/cargo-about/blob/main/.github/workflows/rust-ci.yml (MIT or APACHE 2.0)
# When run in a container, the ownership will be messed up, so mark the
# checkout dir as safe regardless of our env
git config --global --add safe.directory "$GITHUB_WORKSPACE"

# Normally we'll only do this on tags, but add --always to fallback to the revision
# if we're iterating or the like
tag=$(git describe --tags --abbrev=0 --always)

if [[ ${tag:0:1} != "v" ]]; then
tag="nightly"
fi

release_name="$NAME-$tag-$TARGET"
release_zip="${release_name}.zip"
release_tar="${release_name}.tar.gz"

mkdir "$release_name"

if [[ "$TARGET" =~ windows ]]; then
bin="$NAME.exe"
cp "examples/target/$TARGET/release-action/$bin" "$release_name/"
cp README.md LICENSE "$release_name/"
7z a -tzip "$release_zip" "$release_name"
else
bin="$NAME"
cp "examples/target/$TARGET/release-action/$bin" "$release_name/"
cp README.md LICENSE "$release_name/"
tar czf "$release_tar" "$release_name"
fi

rm -r "$release_name"

# Windows environments in github actions don't have the gnu coreutils installed,
# which includes the shasum exe, so we just use powershell instead
if [[ "$TARGET" =~ windows ]]; then
echo "(Get-FileHash \"${release_zip}\" -Algorithm SHA256).Hash | Out-File -Encoding ASCII -NoNewline \"${release_zip}.sha256\"" | pwsh -c -
else
echo -n "$(shasum -ba 256 "${release_tar}" | cut -d " " -f 1)" > "${release_tar}.sha256"
fi
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release Example Binary

permissions:
contents: write

on:
push:
tags:
- v[0-9]+.*

jobs:
upload-release:
strategy:
matrix:
info:
- os: "macOS-latest"
target: "x86_64-apple-darwin"
- os: "macOS-latest"
target: "aarch64-apple-darwin"
- os: "windows-latest"
target: "x86_64-pc-windows-msvc"
- os: "ubuntu-latest"
target: "x86_64-unknown-linux-gnu"
runs-on: ${{ matrix.info.os }}
steps:
- name: Setup Stable Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.info.target }}
components: clippy, rustfmt

- name: Build Example
run: cd examples && cargo build --release --target ${{ matrix.info.target }}

- name: Package Example
shell: bash
env:
NAME: unifiedlog_iterator
TARGET: ${{ matrix.info.target }}
run: .github/scripts/package.sh

- name: Release
uses: softprops/action-gh-release@v2
with:
files: "unifiedlog_iterator*"
name: "${{ vars.GITHUB_REF_NAME }} - Released!"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ keywords = ["forensics", "macOS", "unifiedlog"]

[dependencies]
nom = "7.1.3"
serde_json = "1.0.133"
serde = { version = "1.0.215", features = ["derive"] }
serde_json = "1.0.135"
serde = { version = "1.0.217", features = ["derive"] }
log = "0.4.22"
lz4_flex = "0.11.3"
byteorder = "1.5.0"
plist = "1.7.0"
regex = "1.11.1"
base64 = "0.22.1"
chrono = "0.4.38"
chrono = "0.4.39"
walkdir = "2.5.0"

[dev-dependencies]
simplelog = "0.12.2"
csv = "1.3.1"
chrono = "0.4.38"
criterion = "0.5.1"
anyhow = "1.0.94"
anyhow = "1.0.95"
test-case = "3.3"

[[bench]]
Expand Down
9 changes: 1 addition & 8 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,7 @@ ignore = []
# List of explicitly allowed licenses
# See https://spdx.org/licenses/ for list of possible licenses
# [possible values: any SPDX 3.11 short identifier (+ optional exception)].
allow = [
"MIT",
"Apache-2.0",
"BSL-1.0",
"Unlicense",
"Unicode-DFS-2016",
"Unicode-3.0",
]
allow = ["MIT", "Apache-2.0", "BSL-1.0", "Unlicense", "Unicode-3.0"]
# List of explicitly disallowed licenses
# See https://spdx.org/licenses/ for list of possible licenses
# [possible values: any SPDX 3.11 short identifier (+ optional exception)].
Expand Down
5 changes: 4 additions & 1 deletion src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ pub fn collect_timesync(provider: &dyn FileProvider) -> Result<Vec<TimesyncBoot>

#[cfg(test)]
mod tests {
use crate::filesystem::{LiveSystemProvider, LogarchiveProvider};
use crate::filesystem::LogarchiveProvider;
use crate::parser::{
build_log, collect_shared_strings, collect_strings, collect_timesync, parse_log,
};
Expand All @@ -183,6 +183,7 @@ mod tests {
#[test]
#[cfg(target_os = "macos")]
fn test_collect_strings_system() {
use crate::filesystem::LiveSystemProvider;
let system_provider = LiveSystemProvider::default();
let uuidtext_results = collect_strings(&system_provider).unwrap();
assert!(uuidtext_results.len() > 100);
Expand All @@ -191,6 +192,7 @@ mod tests {
#[test]
#[cfg(target_os = "macos")]
fn test_collect_timesync_system() {
use crate::filesystem::LiveSystemProvider;
let system_provider = LiveSystemProvider::default();
let timesync_results = collect_timesync(&system_provider).unwrap();
assert!(timesync_results.len() > 1);
Expand Down Expand Up @@ -225,6 +227,7 @@ mod tests {
#[test]
#[cfg(target_os = "macos")]
fn test_collect_shared_strings_system() {
use crate::filesystem::LiveSystemProvider;
let system_provider = LiveSystemProvider::default();
let shared_strings_results = collect_shared_strings(&system_provider).unwrap();
assert!(shared_strings_results[0].ranges.len() > 1);
Expand Down
Loading