Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
topher-lo committed Feb 27, 2024
0 parents commit 4588d42
Show file tree
Hide file tree
Showing 18 changed files with 756 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/release-drafter-engine.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
_extends: tracecat:.github/release-drafter.yml

name-template: Tracecat Engine $RESOLVED_VERSION
tag-template: engine-$RESOLVED_VERSION
tag-prefix: engine-

include-labels:
- engine

version-resolver:
minor:
labels:
- breaking
- breaking engine
default: patch

categories:
- title: 🏆 Highlights
labels: highlight
- title: 💥 Breaking changes
labels:
- breaking
- breaking engine
- title: ⚠️ Deprecations
labels: deprecation
- title: 🚀 Performance improvements
labels: performance
- title: ✨ Enhancements
labels: enhancement
- title: 🐞 Bug fixes
labels: fix
- title: 📖 Documentation
labels: documentation
- title: 📦 Build system
labels: build
- title: 🛠️ Other improvements
labels: internal
40 changes: 40 additions & 0 deletions .github/release-drafter-ui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
_extends: tracecat:.github/release-drafter.yml

name-template: Tracecat UI $RESOLVED_VERSION
tag-template: ui-$RESOLVED_VERSION
tag-prefix: ui-

include-labels:
- ui
- frontend

version-resolver:
minor:
labels:
- breaking
- breaking ui
- breaking frontend
default: patch

categories:
- title: 🏆 Highlights
labels: highlight
- title: 💥 Breaking changes
labels:
- breaking
- breaking ui
- breaking frontend
- title: ⚠️ Deprecations
labels: deprecation
- title: 🚀 Performance improvements
labels: performance
- title: ✨ Enhancements
labels: enhancement
- title: 🐞 Bug fixes
labels: fix
- title: 📖 Documentation
labels: documentation
- title: 📦 Build system
labels: build
- title: 🛠️ Other improvements
labels: internal
62 changes: 62 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
exclude-labels:
- skip changelog
- release

change-template: '- $TITLE (#$NUMBER)'
change-title-escapes: '\<*_&'
replacers:
# Remove conventional commits from titles
- search: '/- (build|chore|ci|depr|docs|feat|fix|perf|refactor|release|test)(\(.*\))?(\!)?\: /g'
replace: '- '

autolabeler:
- label: frontend
title:
# Example: feat(ui): ...
- '/^(build|chore|ci|depr|docs|feat|fix|perf|refactor|release|test)(\(.*ui.*\))?\!?\: /'
- label: engine
title:
# Example: feat(engine): ...
- '/^(build|chore|ci|depr|docs|feat|fix|perf|refactor|release|test)(\(.*engine.*\))?\!?\: /'
- label: breaking
title:
# Example: feat!: ...
- '/^(build|chore|ci|depr|docs|feat|fix|perf|refactor|release|test)(\(.*\))?\!\: /'
- label: breaking frontend
title:
# Example: feat(ui!, engine): ...
- '/^(build|chore|ci|depr|docs|feat|fix|perf|refactor|release|test)\(.*ui\!.*\)\: /'
- label: breaking engine
title:
# Example: feat(engine!): ...
- '/^(build|chore|ci|depr|docs|feat|fix|perf|refactor|release|test)\(.*engine\!.*\)\: /'
- label: build
title:
- '/^build/'
- label: internal
title:
- '/^(chore|ci|refactor|test)/'
- label: deprecation
title:
- '/^depr/'
- label: documentation
title:
- '/^docs/'
- label: enhancement
title:
- '/^feat/'
- label: fix
title:
- '/^fix/'
- label: performance
title:
- '/^perf/'
- label: release
title:
- '/^release/'

template: |
$CHANGES
Thank you to all our contributors for making this release possible!
$CONTRIBUTORS
55 changes: 55 additions & 0 deletions .github/workflows/lint-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Lint Python

on:
pull_request:
paths:
- py-polars/**
- .github/workflows/lint-python.yml

jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Get ruff version from requirements file
id: version
run: |
VERSION=$(grep -m 1 -oP 'ruff==\K(.*)' requirements-lint.txt)
echo "version=$VERSION" >> $GITHUB_OUTPUT
- uses: chartboost/ruff-action@v1
with:
src: tracecat/
version: ${{ steps.version.outputs.version }}
args: check --no-fix

- uses: chartboost/ruff-action@v1
with:
src: tracecat/
version: ${{ steps.version.outputs.version }}
args: format --diff

mypy:
runs-on: ubuntu-latest
strategy:
fail-fast: false
defaults:
run:
working-directory: tracecat

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install dependencies
run: |
pip install -r requirements-dev.txt
pip install -r requirements-lint.txt
- name: Run mypy
run: mypy
20 changes: 20 additions & 0 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Pull request labeler

on:
pull_request_target:
types: [opened, edited]

permissions:
contents: read
pull-requests: write

jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Label pull request
uses: release-drafter/release-drafter@v6
with:
disable-releaser: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38 changes: 38 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Update draft releases

on:
push:
branches:
- main
workflow_dispatch:
inputs:
# Latest commit to include with the release. If omitted, use the latest commit on the main branch.
sha:
description: Commit SHA
type: string

permissions:
contents: write
pull-requests: read

jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Draft Engine release
uses: release-drafter/release-drafter@v6
with:
config-name: release-drafter-engine.yml
commitish: ${{ inputs.sha || github.sha }}
disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Draft Frontend release
uses: release-drafter/release-drafter@v6
with:
config-name: release-drafter-ui.yml
commitish: ${{ inputs.sha || github.sha }}
disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41 changes: 41 additions & 0 deletions .github/workflows/release-engine.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish

on:
release:
types:
- created

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
# Issue ref: https://github.com/actions/setup-python/issues/436
# cache: "pip"
cache-dependency-path: pyproject.toml
- uses: actions/cache@v3
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-publish
- name: Install build dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install build
- name: Build distribution
run: python -m build
- name: Publish
uses: pypa/[email protected]
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
Loading

0 comments on commit 4588d42

Please sign in to comment.