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
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Bug Report
about: Report a bug here
labels:
- bug
---

# Bug Report

### Expected Behavior
Add here...

### Actual Behavior
Add here...

### Steps to Reproduce the Problem

1.
2.
3.

### Specifications

- OS platform:
- Rust version:
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: General Questions
url: https://github.com/databento/epoch/discussions
about: Please ask questions like "How do I achieve x?" here.
- name: DatabentoHQ
url: https://twitter.com/DatabentoHQ
about: Follow us on twitter for news and updates!
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: Feature Request
about: Request a new feature to be added here
labels:
- enhancement
---

# Feature Request

Please provide a detailed description of your proposal, with some examples.
38 changes: 38 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Pull request

Please include a summary of the changes.
Please also include relevant motivation and context.
List any dependencies that are required for this change.

Fixes # (issue)

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

## How has this change been tested?

Please describe the tests that you ran to verify your changes.
Provide instructions so we can reproduce.
Please also list any relevant details for your test configuration.

- [ ] Test A
- [ ] Test B

## Checklist

- [ ] My code builds locally with no new warnings (`scripts/build.sh`)
- [ ] My code follows the style guidelines (`scripts/lint.sh` and `scripts/format.sh`)
- [ ] New and existing unit tests pass locally with my changes (`scripts/test.sh`)
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my feature works

## Declaration

I confirm this contribution is made under an Apache 2.0 license and that I have the authority
necessary to make this contribution on behalf of its copyright owner.
41 changes: 41 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: build
on:
pull_request:
push:

jobs:
build:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
name: build (${{ matrix.os }})
runs-on: ${{ matrix.os }}

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Rust
run: rustup toolchain add --profile minimal stable --component clippy,rustfmt
# Cargo setup
- name: Set up Cargo cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}

- name: Format
run: scripts/format.sh
shell: bash
- name: Build
run: scripts/build.sh
shell: bash
- name: Lint
run: scripts/lint.sh
shell: bash
- name: Test
run: scripts/test.sh
shell: bash
69 changes: 69 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: release
on:
workflow_run:
workflows: [build]
branches: [main]
types:
- completed
workflow_dispatch:
branches: [main]

jobs:
tag-release:
if: ${{ github.event.workflow_run.conclusion == 'success' }} || ${{ github.event.workflow_dispatch }}
name: tag-release (ubuntu-latest)
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create-release.outputs.upload_url }}

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Rust
run: rustup toolchain add --profile minimal stable --component clippy,rustfmt

# Cargo setup
- name: Set up Cargo cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}

# Tag the commit with the library version
- name: Create git tag
uses: salsify/action-detect-and-tag-new-version@v2
with:
version-command: scripts/get_version.sh

# Set release output variables
- name: Set output
id: vars
run: |
echo "TAG_NAME=v$(scripts/get_version.sh)" >> $GITHUB_ENV
echo "RELEASE_NAME=$(scripts/get_version.sh)" >> $GITHUB_ENV
echo "## Release notes" > NOTES.md
sed -n '/^## /{n; :a; /^## /q; p; n; ba}' CHANGELOG.md >> NOTES.md
# Create GitHub release
- name: Create release
id: create-release
uses: softprops/action-gh-release@v1
with:
name: ${{ env.RELEASE_NAME }}
tag_name: ${{ env.TAG_NAME }}
append_body: true
body_path: ./NOTES.md
prerelease: false

- name: Remove notes
# Force to not error if it doesn't exist
run: rm --force NOTES.md

- name: Publish to crates.io
run: cargo publish --token ${CARGO_REGISTRY_TOKEN}
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Changelog

## 0.3.0 - 2025-09-11
- Initial public release
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "epoch"
name = "epoch-to"
authors = ["Databento <support@databento.com>"]
version = "0.3.0"
edition = "2021"
Expand All @@ -11,6 +11,9 @@ keywords = ["epoch", "timestamps"]
# see https://crates.io/category_slugs
categories = ["command-line-utilities", "date-and-time", "value-formatting"]

[[bin]]
name = "epoch"
path = "src/main.rs"

[dependencies]
anyhow = "1.0.98"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

[![build](https://github.com/databento/epoch/actions/workflows/build.yaml/badge.svg)](https://github.com/databento/epoch/actions/workflows/build.yaml)
[![license](https://img.shields.io/github/license/databento/epoch?color=blue)](./LICENSE)
[![Current Crates.io Version](https://img.shields.io/crates/v/epoch-cli.svg)](https://crates.io/crates/epoch-cli)
[![Current Crates.io Version](https://img.shields.io/crates/v/epoch-to.svg)](https://crates.io/crates/epoch-to)

Utility for making UNIX timestamps human-readable
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ fn main() -> anyhow::Result<()> {
for line in stdin().lock().lines() {
reformatter.write(&mut output, &line?)?;
output.write_all(b"\n")?;
output.flush()?;
}
}

Expand Down
Loading