Skip to content

Add stateful block-wise processing to OctaveFilterBank and WeightingF… #18

Add stateful block-wise processing to OctaveFilterBank and WeightingF…

Add stateful block-wise processing to OctaveFilterBank and WeightingF… #18

Workflow file for this run

name: Publish to PyPI and Release
on:
push:
branches:
- main
paths-ignore:
- 'README.md'
- '.github/**'
workflow_dispatch:
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
if: github.repository == 'jmrplens/PyOctaveBand' && !contains(github.event.head_commit.message, 'skip ci')
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.TOKEN_GH }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Bump version
id: bump
run: |
# Read current version from pyproject.toml
# Look for 'version =' specifically in the [project] section or at line start
CURRENT_VERSION=$(grep -m 1 -oP '^version\s*=\s*"\K[^"]+' pyproject.toml)
echo "Current version: $CURRENT_VERSION"
# Increment patch version
IFS='.' read -r major minor patch <<< "$CURRENT_VERSION"
NEW_PATCH=$((patch + 1))
NEW_VERSION="$major.$minor.$NEW_PATCH"
echo "New version: $NEW_VERSION"
# Update pyproject.toml
sed -i "s/^version = \"$CURRENT_VERSION\"/version = \"$NEW_VERSION\"/" pyproject.toml
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
- name: Commit and push changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add pyproject.toml
git commit -m "chore: bump version to ${{ steps.bump.outputs.version }} [skip ci]"
git push origin main
- name: Create Git Tag
run: |
git tag v${{ steps.bump.outputs.version }}
git push origin v${{ steps.bump.outputs.version }}
- name: Build package
run: python -m build
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: python -m twine upload dist/*
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.bump.outputs.version }}
name: Release v${{ steps.bump.outputs.version }}
body: |
Automated release for version v${{ steps.bump.outputs.version }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.TOKEN_GH }}