Skip to content
Merged
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
4 changes: 4 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
pull_request:
types: [opened, reopened]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
pull_request:
types: [opened, reopened]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
readme:
runs-on: ${{ matrix.os }}
Expand Down
81 changes: 81 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Release
on:
release:
types: [published]
branches:
- main
- stable

workflow_dispatch:
inputs:
candidate:
description: 'Release candidate.'
required: true
type: boolean
default: true
test_pypi:
description: 'Test PyPI.'
type: boolean
default: false
jobs:
release:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.candidate && 'main' || 'stable' }}

- name: Set up latest Python
uses: actions/setup-python@v5
with:
python-version-file: 'pyproject.toml'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[dev]

- name: Create wheel
run: |
make dist

- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: ${{ inputs.test_pypi && 'https://test.pypi.org/legacy/' || 'https://upload.pypi.org/legacy/' }}

- name: Bump version to next candidate
if: ${{ inputs.candidate && !inputs.test_pypi }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
bump-my-version bump candidate --no-tag --no-commit

- name: Create pull request
if: ${{ inputs.candidate && !inputs.test_pypi }}
id: cpr
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GH_ACCESS_TOKEN }}
commit-message: bumpversion-candidate
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>
signoff: false
delete-branch: true
title: Automated Bump Version Candidate
body: "This is an auto-generated PR that bumps the version to the next candidate."
branch: bumpversion-candidate-update
branch-suffix: short-commit-hash
add-paths: |
deepecho/__init__.py
pyproject.toml
draft: false
base: main

- name: Enable Pull Request Automerge
if: ${{ steps.cpr.outputs.pull-request-operation == 'created' }}
run: gh pr merge "${{ steps.cpr.outputs.pull-request-number }}" --squash --auto
env:
GH_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
4 changes: 4 additions & 0 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
pull_request:
types: [opened, reopened]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
unit:
runs-on: ${{ matrix.os }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
tests/readme_test/README.md

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
60 changes: 33 additions & 27 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ clean-coverage: ## remove coverage artifacts

.PHONY: clean-test
clean-test: ## remove test artifacts
rm -fr .tox/
rm -fr .pytest_cache

.PHONY: clean
Expand All @@ -76,6 +75,9 @@ install-test: clean-build clean-pyc ## install the package and test dependencies
install-develop: clean-build clean-pyc ## install the package in editable mode and dependencies for development
pip install -e .[dev]

.PHONY: install-readme
install-readme: clean-build clean-pyc ## install the package in editable mode and readme dependencies for developement
pip install -e .[readme]

# LINT TARGETS

Expand Down Expand Up @@ -116,10 +118,6 @@ test: test-unit test-integration test-readme test-tutorials ## test everything t
.PHONY: test-devel
test-devel: lint ## test everything that needs development dependencies

.PHONY: test-all
test-all: ## run tests on every Python version with tox
tox -r

.PHONY: coverage
coverage: ## check code coverage quickly with the default Python
coverage run --source deepecho -m pytest
Expand All @@ -129,11 +127,6 @@ coverage: ## check code coverage quickly with the default Python


# RELEASE TARGETS

.PHONY: git-push
git-push: ## Simply push the repository to github
git push

.PHONY: dist
dist: clean ## builds source and wheel package
python -m build --wheel --sdist
Expand All @@ -154,41 +147,47 @@ publish-test: dist publish-confirm ## package and upload a release on TestPyPI
publish: dist publish-confirm ## package and upload a release
twine upload dist/*

.PHONY: bumpversion-release
bumpversion-release: ## Merge main to stable and bumpversion release
.PHONY: git-merge-main-stable
git-merge-main-stable: ## Merge main into stable
git checkout stable || git checkout -b stable
git merge --no-ff main -m"make release-tag: Merge branch 'main' into stable"
bump-my-version bump release

.PHONY: git-merge-stable-main
git-merge-stable-main: ## Merge stable into main
git checkout main
git merge stable

.PHONY: git-push
git-push: ## Simply push the repository to github
git push

.PHONY: git-push-tags-stable
git-push-tags-stable: ## Push tags and stable to github
git push --tags origin stable

.PHONY: bumpversion-release-test
bumpversion-release-test: ## Merge main to stable and bumpversion release
git checkout stable || git checkout -b stable
git merge --no-ff main -m"make release-tag: Merge branch 'main' into stable"
.PHONY: bumpversion-release
bumpversion-release: ## Bump the version to the next release
bump-my-version bump release --no-tag
@echo git push --tags origin stable

.PHONY: bumpversion-patch
bumpversion-patch: ## Merge stable to main and bumpversion patch
git checkout main
git merge stable
bump-my-version bump patch --no-tag
git push
bumpversion-patch: ## Bump the version to the next patch
bump-my-version bump --no-tag patch

.PHONY: bumpversion-candidate
bumpversion-candidate: ## Bump the version to the next candidate
bump-my-version bump candidate --no-tag

.PHONY: bumpversion-minor
bumpversion-minor: ## Bump the version the next minor skipping the release
bump-my-version bump minor --no-tag
bump-my-version bump --no-tag minor

.PHONY: bumpversion-major
bumpversion-major: ## Bump the version the next major skipping the release
bump-my-version bump major --no-tag
bump-my-version bump --no-tag major

.PHONY: bumpversion-revert
bumpversion-revert: ## Undo a previous bumpversion-release
git tag --delete $(shell git tag --points-at HEAD)
git checkout main
git branch -D stable

Expand Down Expand Up @@ -231,13 +230,20 @@ check-release: check-clean check-candidate check-main check-history ## Check if
@echo "A new release can be made"

.PHONY: release
release: check-release bumpversion-release publish bumpversion-patch
release: check-release git-merge-main-stable bumpversion-release git-push-tags-stable \
git-merge-stable-main bumpversion-patch git-push

.PHONY: release-test
release-test: check-release bumpversion-release-test publish-test bumpversion-revert
release-test: check-release git-merge-main-stable bumpversion-release bumpversion-revert

.PHONY: release-candidate
release-candidate: check-main publish bumpversion-candidate git-push

.PHONY: release-candidate-test
release-candidate-test: check-clean check-main publish-test

.PHONY: release-minor
release-minor: check-release bumpversion-minor release

.PHONY: release-major
release-major: check-release bumpversion-major release
Loading
Loading