Skip to content

Commit

Permalink
Add GitHub Actions workflow for automated release process
Browse files Browse the repository at this point in the history
  • Loading branch information
miskibin committed Feb 5, 2025
1 parent 6638e2b commit 0bdeff6
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/python-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Release
on:
push:
tags:
- '*' # Trigger on version tags

env:
UV_VERSION: "0.4.27"

jobs:
build-and-release:
env:
UV_CACHE_DIR: /tmp/.uv-cache
runs-on: ubuntu-24.04
permissions:
contents: write # Needed for creating releases
steps:
- name: Checkout source code
uses: actions/checkout@v4

- name: Set up python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Set up uv
run: curl -LsSf https://astral.sh/uv/${{ env.UV_VERSION }}/install.sh | sh

- name: Restore uv cache
uses: actions/cache@v4
with:
path: /tmp/.uv-cache
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}
- name: Install dependencies
run: uv sync

- name: Install package
run: uv pip install -e .

- name: Build package
run: uv build

- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
files: |
dist/*.whl
dist/*.tar.gz
name: Release ${{ github.ref_name }}
draft: false
prerelease: false
generate_release_notes: true

- name: Minimize uv cache
run: uv cache prune --ci

0 comments on commit 0bdeff6

Please sign in to comment.