Skip to content
Open
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
47 changes: 27 additions & 20 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types:
- closed
branches:
- master # Change to your default branch if different (e.g., master)
- master
workflow_dispatch:

jobs:
Expand All @@ -14,25 +14,32 @@ jobs:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
contents: write # Needed for creating releases
contents: write # Needed for creating releases
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0 # Fetch all history for proper versioning and commit messages
fetch-depth: 0 # Fetch all history for proper versioning and commit messages

- name: Get latest release version
id: get_version
run: |
# Get latest tag or set to v0.0.0 if none exists
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
echo "LATEST_TAG=${LATEST_TAG}" >> $GITHUB_ENV

# Extract version numbers
MAJOR=$(echo $LATEST_TAG | sed 's/v\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/')
MINOR=$(echo $LATEST_TAG | sed 's/v\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/')
PATCH=$(echo $LATEST_TAG | sed 's/v\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/')

TAG_VERSION="${LATEST_TAG#v}"
if [[ "$TAG_VERSION" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
MAJOR="${BASH_REMATCH[1]}"
MINOR="${BASH_REMATCH[2]}"
PATCH="${BASH_REMATCH[3]}"
else
MAJOR=0
MINOR=0
PATCH=0
fi

# Check PR labels to determine which version to increment
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'major') }}" == "true" ]]; then
echo "Incrementing MAJOR version due to 'major' label"
Expand All @@ -47,7 +54,7 @@ jobs:
echo "Incrementing PATCH version (default)"
PATCH=$((PATCH + 1))
fi

NEW_TAG="v$MAJOR.$MINOR.$PATCH"
echo "Bumping version from $LATEST_TAG to $NEW_TAG"
echo "NEW_TAG=${NEW_TAG}" >> $GITHUB_ENV
Expand All @@ -58,13 +65,13 @@ jobs:
# Get commits since last tag
echo "Generating commit list since $LATEST_TAG"
COMMITS=$(git log --pretty=format:"- %s (%h)" ${{ env.LATEST_TAG }}..HEAD)

# Extract PR details
PR_TITLE="${{ github.event.pull_request.title }}"
PR_NUMBER="${{ github.event.pull_request.number }}"
PR_BODY="${{ github.event.pull_request.body }}"
PR_USER="${{ github.event.pull_request.merged_by.login }}"

# Save release notes to environment variable
echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
echo "## Release ${{ env.NEW_TAG }}" >> $GITHUB_ENV
Expand All @@ -73,25 +80,25 @@ jobs:
echo "- #$PR_NUMBER: $PR_TITLE" >> $GITHUB_ENV
echo "- Merged by @$PR_USER" >> $GITHUB_ENV
echo "" >> $GITHUB_ENV

if [[ -n "$PR_BODY" ]]; then
echo "### 📝 Description" >> $GITHUB_ENV
echo "$PR_BODY" >> $GITHUB_ENV
echo "" >> $GITHUB_ENV
fi

echo "### 📦 Changes" >> $GITHUB_ENV
echo "$COMMITS" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV

- name: Create Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.NEW_TAG }}
name: Release ${{ env.NEW_TAG }}
body: ${{ env.RELEASE_NOTES }}
draft: false # Set to true if you want to review before publishing
prerelease: false # Set to true for pre-releases
draft: false # Set to true if you want to review before publishing
prerelease: false # Set to true for pre-releases
# If you have build artifacts to include, uncomment and modify this:
# files: |
# dist/*.zip
Expand All @@ -101,4 +108,4 @@ jobs:

- name: Output Results
run: |
echo "::notice::🎉 Created release ${{ env.NEW_TAG }} from PR #${{ github.event.pull_request.number }}"
echo "::notice::🎉 Created release ${{ env.NEW_TAG }} from PR #${{ github.event.pull_request.number }}"
12 changes: 6 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v6

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v6
with:
node-version: '18'
node-version: "lts/*"

- name: Install dependencies
run: |
Expand All @@ -29,10 +29,10 @@ jobs:

- name: Create .nojekyll file
run: |
touch docs-site/out/.nojekyll
touch docs-site/out/.nojekyll

- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs-site/out
branch: gh-pages
folder: docs-site/out
branch: gh-pages
42 changes: 24 additions & 18 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,27 @@ on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install uv
run: pip install uv
- name: Create virtual environment
run: uv venv
- name: Install dependencies
run: |
uv pip install -e ".[dev]"
uv pip install black
- name: format
run: uv run black --check .
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.10"

- name: Install uv
run: pip install uv

- name: Create virtual environment
run: uv venv

- name: Install dependencies
run: |
uv pip install -e ".[dev]"
uv pip install black

- name: format
run: uv run black --check .
37 changes: 21 additions & 16 deletions .github/workflows/install.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
name: Install
on:
push:
branches: [ "master" ]
branches: ["master"]
pull_request:
branches: [ "master" ]
branches: ["master"]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install uv
run: pip install uv
- name: Create virtual environment
run: uv venv
- name: Install package
run: uv pip install -e .
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.10"

- name: Install uv
run: pip install uv

- name: Create virtual environment
run: uv venv

- name: Install package
run: uv pip install -e .
48 changes: 27 additions & 21 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,30 @@ on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install uv
run: pip install uv
- name: Create virtual environment
run: uv venv
- name: Install dependencies
run: |
uv pip install -e ".[dev]"
uv pip install ruff flake8
- name: lint
run: |
uv run ruff check --fix .
uv run ruff check .
uv run flake8 yake/
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.10"

- name: Install uv
run: pip install uv

- name: Create virtual environment
run: uv venv

- name: Install dependencies
run: |
uv pip install -e ".[dev]"
uv pip install ruff flake8

- name: lint
run: |
uv run ruff check --fix .
uv run ruff check .
uv run flake8 yake/
12 changes: 7 additions & 5 deletions .github/workflows/publishpypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v6

- uses: actions/setup-python@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.10"

Expand All @@ -34,7 +36,7 @@ jobs:
python -m build

- name: Upload distributions
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: release-dists
path: dist/
Expand All @@ -60,12 +62,12 @@ jobs:

steps:
- name: Retrieve release distributions
uses: actions/download-artifact@v4
uses: actions/download-artifact@v7
with:
name: release-dists
path: dist/

- name: Publish release distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
packages-dir: dist/
31 changes: 16 additions & 15 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,20 @@ on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint>=3.3.0
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py') --fail-under=9.0
- name: Checkout
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.10"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint>=3.3.0

- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py') --fail-under=9.0
Loading