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
58 changes: 58 additions & 0 deletions .github/workflows/docker_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Publish a Docker Image

on:
push:
branches: ["master"]
paths:
- "src/**"
- "Cargo.lock"

env:
CARGO_TERM_COLOR: always

jobs:
publish-docker-image:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v6

- name: Check out repository
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- name: Get crate version
run: CRATE_VERSION=$(python scripts/get_version_number.py); echo "CRATE_VERSION=$CRATE_VERSION" >> $GITHUB_ENV

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
enable-cache: true

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:v${{ env.CRATE_VERSION }}
cache-from: type=gha
cache-to: type=gha,mode=max
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tau"
version = "0.1.16"
version = "0.1.17"
edition = "2021"
repository = "https://github.com/debatecore/tau"

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "tau"
version = "0.1.16"
version = "0.1.17"
description = "A project for versioning python-based tau development utils"
readme = "README.md"
requires-python = ">=3.13"
Expand Down
15 changes: 15 additions & 0 deletions scripts/get_version_number.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env python3
from pathlib import Path

from check_version import extract_version

VERSION_FILE = "Cargo.toml"


def main():
print(extract_version(VERSION_FILE, Path(VERSION_FILE).read_text()))
return 0


if __name__ == "__main__":
raise SystemExit(main())
2 changes: 1 addition & 1 deletion uv.lock

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