Skip to content

Commit

Permalink
ci: use release-please rather than versioneer (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe committed Jan 15, 2024
1 parent dcb8942 commit 864aa4b
Show file tree
Hide file tree
Showing 16 changed files with 153 additions and 2,998 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 }}
37 changes: 32 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,41 @@
name: CI

on: [push]
on:
push:

jobs:
build:
cancel-previous:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/master'
steps:
- uses: khan/[email protected]
with:
workflows: CI
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'

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 +59,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/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
validateSingleCommit: true
21 changes: 21 additions & 0 deletions .github/workflows/deps-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: deps-report

on:
pull_request:

jobs:
build:
name: Dependencies report
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
lfs: true

- name: deps-report
uses: MeilleursAgents/deps-report@master
with:
file: Pipfile.lock
github_token: ${{ secrets.GITHUB_TOKEN }}
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

0 comments on commit 864aa4b

Please sign in to comment.