Skip to content

Commit

Permalink
ci: use release-please rather than versioneer (#118) (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe authored Jan 18, 2024
1 parent 2572456 commit 7e13aca
Show file tree
Hide file tree
Showing 14 changed files with 128 additions and 2,996 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ insert_final_newline = true
charset = utf-8
end_of_line = lf

[*.{yml,yaml}]
indent_size = 2

[*.bat]
indent_style = tab
end_of_line = crlf
Expand Down
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
19 changes: 19 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: dependabot auto-merge

on: pull_request

permissions:
contents: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
# GitHub provides this variable in the CI env. You don't
# need to add anything to the secrets vault.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27 changes: 22 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
name: CI

on: [push]
on:
push:

jobs:
build:
lint:
runs-on: ubuntu-latest
steps:
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.12"

- name: Checkout repository
uses: actions/checkout@v3
with:
lfs: true

- name: Install test dependencies via pip
run: pip install -r requirements/test_black.txt

- name: Lint
run: make lint

build:
runs-on: ubuntu-latest
needs: lint
strategy:
matrix:
python-version:
Expand All @@ -29,9 +49,6 @@ jobs:
- name: Install test dependencies via pip
run: pip install -r requirements/test_black.txt

- name: Lint
run: make lint

- name: Run tests
run: |
make test
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/conventional-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: conventional-prs

on:
pull_request_target:
types:
- opened
- reopened
- edited
- synchronize

jobs:
title-format:
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v3.4.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
validateSingleCommit: true
44 changes: 44 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
on:
push:
branches:
- master

name: release-please

jobs:
release:
runs-on: ubuntu-latest
steps:

- name: Create GitHub release
uses: GoogleCloudPlatform/release-please-action@v3
id: release
with:
release-type: python
package-name: altamisa
token: ${{ secrets.BOT_TOKEN }}

- uses: actions/checkout@v4
if: ${{ steps.release.outputs.release_created }}
with:
fetch-depth: 0

- name: Set up Python
if: ${{ steps.release.outputs.release_created }}
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Build package
if: ${{ steps.release.outputs.release_created }}
run: |
python -m pip install --upgrade pip
pip install -U setuptools
python setup.py sdist
- name: Publish to PyPI
if: ${{ steps.release.outputs.release_created }}
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
3 changes: 1 addition & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ recursive-exclude * *.py[co]

recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif

include versioneer.py
include altamisa/_version.py
include altamisa/py.typed
recursive-include altamisa *.py

include requirements.txt requirements/*.txt
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ format-isort:

.PHONY: lint-black
lint-black:
black -l 100 --exclude "versioneer.py|_version.py" --check .
black -l 100 --check .

.PHONY: format-black
format-black:
black -l 100 --exclude "versioneer.py|_version.py" .
black -l 100 .

.PHONY: lint-flake8
lint-flake8:
Expand Down
9 changes: 1 addition & 8 deletions altamisa/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
from ._version import get_versions

__version__ = get_versions()["version"]
del get_versions

from . import _version

__version__ = _version.get_versions()["version"]
from ._version import __version__ # noqa
Loading

0 comments on commit 7e13aca

Please sign in to comment.