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
99 changes: 99 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,102 @@ jobs:
run: cargo publish --token ${CARGO_REGISTRY_TOKEN}
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}


build-cli-artifacts:
needs: [tag-release]
runs-on: ${{ matrix.os }}
env:
TARGET_FLAGS:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
- os: macos-latest
target: x86_64-apple-darwin
- os: macos-latest
target: x86_64-apple-darwin
- os: macos-latest
target: aarch64-apple-darwin
- os: windows-latest
target: aarch64-pc-windows-msvc
- os: windows-latest
target: x86_64-pc-windows-msvc

steps:
- name: Checkout repository
uses: actions/checkout@v5

- name: Set up Rust
run: rustup toolchain add --profile minimal --target ${{ matrix.target }} stable

- name: Install cross
run: cargo install cross

- name: Set target variables
shell: bash
run: |
echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV
echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV

- name: Build release binary
shell: bash
# cd ensures we only pull in CLI dependencies
run: |
cross build --release ${{ env.TARGET_FLAGS }}
if [ "${{ matrix.os }}" = "windows-latest" ]; then
bin="target/${{ matrix.target }}/release/epoch.exe"
else
bin="target/${{ matrix.target }}/release/epoch"
fi
stat $bin
echo "BIN=$bin" >> $GITHUB_ENV

- name: Determine archive name
shell: bash
run: |
version="$(scripts/get_version.sh)"
echo "ARCHIVE=epoch-$version-${{ matrix.target }}" >> $GITHUB_ENV
echo "VERSION=$version" >> $GITHUB_ENV

- name: Creating directory for archive
shell: bash
run: |
mkdir -p "$ARCHIVE"/doc
cp "$BIN" "$ARCHIVE"/
cp {README.md,LICENSE} "$ARCHIVE"/
cp CHANGELOG.md "$ARCHIVE"/doc/

- name: Build archive (Windows)
shell: bash
if: matrix.os == 'windows-latest'
run: |
7z a "$ARCHIVE.zip" "$ARCHIVE"
certutil -hashfile "$ARCHIVE.zip" SHA256 > "$ARCHIVE.zip.sha256"
echo "ASSET=$ARCHIVE.zip" >> $GITHUB_ENV
echo "ASSET_SUM=$ARCHIVE.zip.sha256" >> $GITHUB_ENV

- name: Build archive (Unix)
shell: bash
if: matrix.os != 'windows-latest'
run: |
tar czf "$ARCHIVE.tar.gz" "$ARCHIVE"
shasum -a 256 "$ARCHIVE.tar.gz" > "$ARCHIVE.tar.gz.sha256"
echo "ASSET=$ARCHIVE.tar.gz" >> $GITHUB_ENV
echo "ASSET_SUM=$ARCHIVE.tar.gz.sha256" >> $GITHUB_ENV

- name: Upload release archive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
# clobber to overwrite if we have to rerun the release
run: |
gh release upload v${{ env.VERSION }} ${{ env.ASSET }} ${{ env.ASSET_SUM }} --clobber
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Changelog

## 0.3.1 - 2025-12-03
- Add pre-built binaries to the release artifacts

## 0.3.0 - 2025-09-11
- Initial public release
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "epoch-to"
authors = ["Databento <support@databento.com>"]
version = "0.3.0"
version = "0.3.1"
edition = "2021"
repository = "https://github.com/databento/epoch"
description = "CLI tool for converting UNIX timestamps to human-readable date strings"
Expand Down