Skip to content

Commit

Permalink
chore: add check & publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
dest1n1s committed Nov 4, 2024
1 parent 60332d1 commit 4a48977
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Checks

on:
push:
branches:
- main
- dev
paths:
- "**" # Include all files by default
- "!.devcontainer/**"
- "!.vscode/**"
- "!.git*"
- "!*.md"
- "!.github/**"
- ".github/workflows/checks.yml" # Still include current workflow
pull_request:
branches:
- main
- dev
paths:
- "**"
- "!.devcontainer/**"
- "!.vscode/**"
- "!.git*"
- "!*.md"
- "!.github/**"
- ".github/workflows/checks.yml"
# Allow this workflow to be called from other workflows
workflow_call:
inputs:
# Requires at least one input to be valid, but in practice we don't need any
dummy:
type: string
required: false

permissions:
actions: write
contents: write

jobs:
code-checks:
name: Code Checks
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: "true"
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: uv.lock
- name: Set up Python
run: uv python install 3.12
- name: Type check
run: uv run mypy .

ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/ruff-action@v1
28 changes: 28 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "Publish"

on:
release:
types: ["published"]

jobs:
run:
name: "Build and publish release"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: uv.lock

- name: Set up Python
run: uv python install 3.12 # Or whatever version I want to use.

- name: Build
run: uv build

- name: Publish
run: uv publish -t ${{ secrets.PYPI_TOKEN }}

0 comments on commit 4a48977

Please sign in to comment.