Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: use release-please rather than versioneer (#118) #119

Merged
Show file tree
Hide file tree
Changes from 6 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
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
sellth marked this conversation as resolved.
Show resolved Hide resolved
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
36 changes: 36 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
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 }}

build-publish:
runs-on: ubuntu-latest
needs: release
steps:

- name: Checkout repository
uses: actions/checkout@v3
if: ${{ steps.release.outputs.release_created }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
if: ${{ steps.release.outputs.release_created }}
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_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