Skip to content

Commit 7392ffa

Browse files
author
Zach Banks
committed
ADD: Add github workflows for epoch
1 parent 786c8b4 commit 7392ffa

File tree

9 files changed

+200
-1
lines changed

9 files changed

+200
-1
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Bug Report
3+
about: Report a bug here
4+
labels:
5+
- bug
6+
---
7+
8+
# Bug Report
9+
10+
### Expected Behavior
11+
Add here...
12+
13+
### Actual Behavior
14+
Add here...
15+
16+
### Steps to Reproduce the Problem
17+
18+
1.
19+
2.
20+
3.
21+
22+
### Specifications
23+
24+
- OS platform:
25+
- Rust version:

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: General Questions
4+
url: https://github.com/databento/epoch/discussions
5+
about: Please ask questions like "How do I achieve x?" here.
6+
- name: DatabentoHQ
7+
url: https://twitter.com/DatabentoHQ
8+
about: Follow us on twitter for news and updates!
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: Feature Request
3+
about: Request a new feature to be added here
4+
labels:
5+
- enhancement
6+
---
7+
8+
# Feature Request
9+
10+
Please provide a detailed description of your proposal, with some examples.

.github/pull_request_template.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Pull request
2+
3+
Please include a summary of the changes.
4+
Please also include relevant motivation and context.
5+
List any dependencies that are required for this change.
6+
7+
Fixes # (issue)
8+
9+
## Type of change
10+
11+
Please delete options that are not relevant.
12+
13+
- [ ] Bug fix (non-breaking change which fixes an issue)
14+
- [ ] New feature (non-breaking change which adds functionality)
15+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
16+
- [ ] This change requires a documentation update
17+
18+
## How has this change been tested?
19+
20+
Please describe the tests that you ran to verify your changes.
21+
Provide instructions so we can reproduce.
22+
Please also list any relevant details for your test configuration.
23+
24+
- [ ] Test A
25+
- [ ] Test B
26+
27+
## Checklist
28+
29+
- [ ] My code builds locally with no new warnings (`scripts/build.sh`)
30+
- [ ] My code follows the style guidelines (`scripts/lint.sh` and `scripts/format.sh`)
31+
- [ ] New and existing unit tests pass locally with my changes (`scripts/test.sh`)
32+
- [ ] I have made corresponding changes to the documentation
33+
- [ ] I have added tests that prove my fix is effective or that my feature works
34+
35+
## Declaration
36+
37+
I confirm this contribution is made under an Apache 2.0 license and that I have the authority
38+
necessary to make this contribution on behalf of its copyright owner.

.github/workflows/build.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: build
2+
on:
3+
pull_request:
4+
push:
5+
6+
jobs:
7+
build:
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
os: [macos-latest, ubuntu-latest, windows-latest]
12+
name: build (${{ matrix.os }})
13+
runs-on: ${{ matrix.os }}
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
- name: Set up Rust
19+
run: rustup toolchain add --profile minimal stable --component clippy,rustfmt
20+
# Cargo setup
21+
- name: Set up Cargo cache
22+
uses: actions/cache@v4
23+
with:
24+
path: |
25+
~/.cargo/registry
26+
~/.cargo/git
27+
target
28+
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
29+
30+
- name: Format
31+
run: scripts/format.sh
32+
shell: bash
33+
- name: Build
34+
run: scripts/build.sh
35+
shell: bash
36+
- name: Lint
37+
run: scripts/lint.sh
38+
shell: bash
39+
- name: Test
40+
run: scripts/test.sh
41+
shell: bash

.github/workflows/release.yaml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: release
2+
on:
3+
workflow_run:
4+
workflows: [build]
5+
branches: [main]
6+
types:
7+
- completed
8+
workflow_dispatch:
9+
branches: [main]
10+
11+
jobs:
12+
tag-release:
13+
if: ${{ github.event.workflow_run.conclusion == 'success' }} || ${{ github.event.workflow_dispatch }}
14+
name: tag-release (ubuntu-latest)
15+
runs-on: ubuntu-latest
16+
outputs:
17+
upload_url: ${{ steps.create-release.outputs.upload_url }}
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 2
24+
- name: Set up Rust
25+
run: rustup toolchain add --profile minimal stable --component clippy,rustfmt
26+
27+
# Cargo setup
28+
- name: Set up Cargo cache
29+
uses: actions/cache@v4
30+
with:
31+
path: |
32+
~/.cargo/registry
33+
~/.cargo/git
34+
target
35+
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
36+
37+
# Tag the commit with the library version
38+
- name: Create git tag
39+
uses: salsify/action-detect-and-tag-new-version@v2
40+
with:
41+
version-command: scripts/get_version.sh
42+
43+
# Set release output variables
44+
- name: Set output
45+
id: vars
46+
run: |
47+
echo "TAG_NAME=v$(scripts/get_version.sh)" >> $GITHUB_ENV
48+
echo "RELEASE_NAME=$(scripts/get_version.sh)" >> $GITHUB_ENV
49+
echo "## Release notes" > NOTES.md
50+
sed -n '/^## /{n; :a; /^## /q; p; n; ba}' CHANGELOG.md >> NOTES.md
51+
# Create GitHub release
52+
- name: Create release
53+
id: create-release
54+
uses: softprops/action-gh-release@v1
55+
with:
56+
name: ${{ env.RELEASE_NAME }}
57+
tag_name: ${{ env.TAG_NAME }}
58+
append_body: true
59+
body_path: ./NOTES.md
60+
prerelease: false
61+
62+
- name: Remove notes
63+
# Force to not error if it doesn't exist
64+
run: rm --force NOTES.md
65+
66+
- name: Publish to crates.io
67+
run: cargo publish --token ${CARGO_REGISTRY_TOKEN}
68+
env:
69+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Changelog
2+
3+
## 0.3.0 - 2025-09-11
4+
- Initial public release

Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "epoch"
2+
name = "epoch-cli"
33
authors = ["Databento <[email protected]>"]
44
version = "0.3.0"
55
edition = "2021"
@@ -11,6 +11,9 @@ keywords = ["epoch", "timestamps"]
1111
# see https://crates.io/category_slugs
1212
categories = ["command-line-utilities", "date-and-time", "value-formatting"]
1313

14+
[[bin]]
15+
name = "epoch"
16+
path = "src/main.rs"
1417

1518
[dependencies]
1619
anyhow = "1.0.98"

src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ fn main() -> anyhow::Result<()> {
155155
for line in stdin().lock().lines() {
156156
reformatter.write(&mut output, &line?)?;
157157
output.write_all(b"\n")?;
158+
output.flush()?;
158159
}
159160
}
160161

0 commit comments

Comments
 (0)