Skip to content

Commit

Permalink
bump version, merge pull request #87 from casperdcl/devel
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl authored Mar 2, 2023
2 parents 045a5de + 937937a commit 606ecb2
Show file tree
Hide file tree
Showing 18 changed files with 654 additions and 720 deletions.
22 changes: 10 additions & 12 deletions .github/workflows/comment-bot.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
name: Comment Bot
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issue_comment: {types: [created]}
pull_request_review_comment: {types: [created]}
jobs:
tag: # /tag <tagname> <commit>
if: startsWith(github.event.comment.body, '/tag ')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: React Seen
uses: actions/github-script@v2
uses: actions/github-script@v6
with:
script: |
const perm = await github.repos.getCollaboratorPermissionLevel({
const perm = await github.rest.repos.getCollaboratorPermissionLevel({
owner: context.repo.owner, repo: context.repo.repo,
username: context.payload.comment.user.login})
post = (context.eventName == "issue_comment"
? github.reactions.createForIssueComment
: github.reactions.createForPullRequestReviewComment)
? github.rest.reactions.createForIssueComment
: github.rest.reactions.createForPullRequestReviewComment)
if (!["admin", "write"].includes(perm.data.permission)){
post({
owner: context.repo.owner, repo: context.repo.repo,
Expand All @@ -39,12 +37,12 @@ jobs:
BODY: ${{ github.event.comment.body }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: React Success
uses: actions/github-script@v2
uses: actions/github-script@v6
with:
script: |
post = (context.eventName == "issue_comment"
? github.reactions.createForIssueComment
: github.reactions.createForPullRequestReviewComment)
? github.rest.reactions.createForIssueComment
: github.rest.reactions.createForPullRequestReviewComment)
post({
owner: context.repo.owner, repo: context.repo.repo,
comment_id: context.payload.comment.id, content: "rocket"})
47 changes: 20 additions & 27 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ name: Test
on:
push:
pull_request:
schedule:
- cron: '3 2 1 * *' # M H d m w (monthly at 2:03)
schedule: [{cron: '3 2 1 * *'}] # M H d m w (monthly at 2:03)
jobs:
check:
if: github.event_name != 'pull_request' || github.head_ref != 'devel'
if: github.event_name != 'pull_request' || !contains('OWNER,MEMBER,COLLABORATOR', github.event.pull_request.author_association)
name: Check
runs-on: ubuntu-latest
steps:
Expand All @@ -16,7 +15,7 @@ jobs:
python-version: '3.x'
- name: Prepare cache
run: echo "PYSHA=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- uses: actions/cache@v1
- uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PYSHA }}|${{ hashFiles('.pre-commit-config.yaml') }}
Expand All @@ -39,17 +38,17 @@ jobs:
- name: Lint
run: pre-commit run -a --show-diff-on-failure
test:
if: github.event_name != 'pull_request' || github.head_ref != 'devel'
if: github.event_name != 'pull_request' || !contains('OWNER,MEMBER,COLLABORATOR', github.event.pull_request.author_association)
name: py${{ matrix.python }}-${{ matrix.os }}
strategy:
matrix:
os: [ubuntu]
python: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, '3.10']
python: [3.7, 3.8, 3.9, '3.10', 3.11]
include:
- os: macos
python: 3.9
python: 3.11
- os: windows
python: 3.9
python: 3.11
runs-on: ${{ matrix.os }}-latest
defaults:
run:
Expand All @@ -75,7 +74,6 @@ jobs:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
finish:
if: github.event_name != 'pull_request' || github.head_ref != 'devel'
name: Coverage
continue-on-error: ${{ github.event_name != 'push' }}
needs: test
Expand Down Expand Up @@ -111,33 +109,28 @@ jobs:
with:
password: ${{ secrets.TWINE_PASSWORD }}
gpg_key: ${{ secrets.GPG_KEY }}
upload: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') }}
upload: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }}
- id: collect_assets
name: Collect assets
run: |
if [[ $GITHUB_REF == refs/tags/v* ]]; then
echo ::set-output name=docker_tags::latest,${GITHUB_REF/refs\/tags\/v/}
echo ::set-output name=snap_channel::stable,candidate,edge
echo docker_tags=latest,${GITHUB_REF/refs\/tags\/v/} >> $GITHUB_OUTPUT
echo snap_channel=stable,candidate,edge >> $GITHUB_OUTPUT
elif [[ $GITHUB_REF == refs/heads/master ]]; then
echo ::set-output name=docker_tags::master
echo ::set-output name=snap_channel::candidate,edge
echo docker_tags=master >> $GITHUB_OUTPUT
echo snap_channel=candidate,edge >> $GITHUB_OUTPUT
elif [[ $GITHUB_REF == refs/heads/devel ]]; then
echo ::set-output name=docker_tags::devel
echo ::set-output name=snap_channel::edge
echo docker_tags=devel >> $GITHUB_OUTPUT
echo snap_channel=edge >> $GITHUB_OUTPUT
fi
echo ::set-output name=tag::${GITHUB_REF#refs/tags/}
git log --pretty='format:%d%n- %s%n%b---' $(git tag --sort=v:refname | tail -n2 | head -n1)..HEAD > _CHANGES.md
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: softprops/action-gh-release@v1
name: Release
run: |
changelog=$(git log --pretty='format:%d%n- %s%n%b---' $(git tag --sort=v:refname | tail -n2 | head -n1)..HEAD)
tag="${GITHUB_REF#refs/tags/}"
gh release create --title "git-fame $tag stable" --draft --notes "$changelog" "$tag" dist/${{ steps.dist.outputs.whl }} dist/${{ steps.dist.outputs.whl_asc }}
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
name: git-fame ${{ steps.collect_assets.outputs.tag }} stable
body_path: _CHANGES.md
draft: true
files: |
dist/${{ steps.dist.outputs.whl }}
dist/${{ steps.dist.outputs.whl_asc }}
GH_TOKEN: ${{ github.token }}
- uses: snapcore/action-build@v1
id: snap_build
- if: github.event_name == 'push' && steps.collect_assets.outputs.snap_channel
Expand Down
2 changes: 1 addition & 1 deletion .meta/.git-fame.1.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% GIT-FAME(1) git-fame User Manuals
% Casper da Costa-Luis <https://github.com/casperdcl>
% 2016-2022
% 2016-2023

# NAME

Expand Down
15 changes: 10 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ default_language_version:
python: python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand Down Expand Up @@ -37,8 +37,8 @@ repos:
- argopt
- tabulate
- tqdm
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
args: [-j8]
Expand All @@ -49,8 +49,13 @@ repos:
- flake8-debugger
- flake8-isort
- flake8-string-format
- flake8-type-annotations
- repo: https://github.com/google/yapf
rev: v0.32.0
hooks:
- id: yapf
args: [-i]
additional_dependencies: [toml]
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9-alpine
FROM python:3.11-alpine
RUN apk update && apk add --no-cache git
COPY dist/*.whl .
RUN pip install -U $(ls *.whl)[full] && rm *.whl
Expand Down
2 changes: 1 addition & 1 deletion LICENCE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
* files: *
MPLv2.0 2016-2022 (c) Casper da Costa-Luis
MPLv2.0 2016-2023 (c) Casper da Costa-Luis
[casperdcl](https://github.com/casperdcl).


Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,8 @@ We are grateful for all |GitHub-Contributions|.

|README-Hits|

.. |Build-Status| image:: https://img.shields.io/github/workflow/status/casperdcl/git-fame/Test/master?logo=GitHub
:target: https://github.com/casperdcl/git-fame/actions?query=workflow%3ATest
.. |Build-Status| image:: https://img.shields.io/github/actions/workflow/status/casperdcl/git-fame/test.yml?branch=master&label=git-fame&logo=GitHub
:target: https://github.com/casperdcl/git-fame/actions/workflows/test.yml
.. |Coverage-Status| image:: https://img.shields.io/coveralls/github/casperdcl/git-fame/master?logo=coveralls
:target: https://coveralls.io/github/casperdcl/git-fame
.. |Branch-Coverage-Status| image:: https://codecov.io/gh/casperdcl/git-fame/branch/master/graph/badge.svg
Expand Down
8 changes: 4 additions & 4 deletions gitfame/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from ._gitfame import (
__author__, __copyright__, __date__, __licence__, __license__, __version__, main)
from ._gitfame import (__author__, __copyright__, __date__, __licence__, __license__, __version__,
main)

__all__ = ['main', '__author__', '__date__', '__licence__', '__copyright__',
'__version__', '__license__']
__all__ = [
'main', '__author__', '__date__', '__licence__', '__copyright__', '__version__', '__license__']
4 changes: 2 additions & 2 deletions gitfame/__main__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from ._gitfame import main # pragma: no cover
from ._gitfame import main # pragma: no cover, yapf: disable

main() # pragma: no cover
main() # pragma: no cover
Loading

0 comments on commit 606ecb2

Please sign in to comment.