Skip to content

Commit

Permalink
💚 Update workflows (#60)
Browse files Browse the repository at this point in the history
- 🔥 Drop Python 3.6
  • Loading branch information
roniemartinez authored Mar 19, 2022
1 parent 81fb238 commit b957525
Show file tree
Hide file tree
Showing 12 changed files with 146 additions and 231 deletions.
3 changes: 0 additions & 3 deletions .github/FUNDING.yml

This file was deleted.

7 changes: 3 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '39 5 * * 1'
- cron: '45 8 * * 4'

jobs:
analyze:
Expand All @@ -33,9 +33,8 @@ jobs:
fail-fast: false
matrix:
language: [ 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This workflow will publish to PyPI
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Publish to PyPI

on:
release:
types:
- published

jobs:
pypi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
pip3 install -U pip setuptools poetry
- name: Build package
run: |
poetry config http-basic.pypi ${{ secrets.PYPI_USER }} ${{ secrets.PYPI_PASS }}
poetry build
- name: Publish package
run: |
poetry publish
63 changes: 11 additions & 52 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,23 @@ name: Python
on:
push:
branches:
- 'master'
- master
pull_request:
branches:
- 'master'
- master
workflow_dispatch:

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

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
python-version: [ '3.6', '3.7', '3.8', '3.9', '3.10' ]
python-version: [ '3.7', '3.8', '3.9', '3.10' ]
include:
- os: ubuntu-latest
pip-cache: ~/.cache/pip
Expand Down Expand Up @@ -62,51 +66,6 @@ jobs:
- name: Test
run: |
make test
- name: Upload Code Coverage
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
poetry run codecov
testpypi:
needs: [ test ]
if: always() && !(github.ref == 'refs/heads/master' || startsWith(github.head_ref, 'dependabot/pip/') )
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
make install-actions
- name: Build package
run: |
poetry config repositories.testpypi https://test.pypi.org/legacy/
poetry config http-basic.testpypi ${{ secrets.TEST_PYPI_USER }} ${{ secrets.TEST_PYPI_PASS }}
poetry build
- name: Publish package
run: |
poetry publish -r testpypi
pypi:
needs: [ test ]
if: always() && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
make install-actions
- name: Build package
run: |
poetry config http-basic.pypi ${{ secrets.PYPI_USER }} ${{ secrets.PYPI_PASS }}
poetry build
- name: Publish package
run: |
poetry publish
- name: Code Coverage
uses: codecov/[email protected]
if: ${{ success() }}
30 changes: 30 additions & 0 deletions .github/workflows/testpypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This workflow will publish to TestPyPI
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Publish to TestPyPI

on:
push:
tags:
- '*'

jobs:
testpypi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
pip3 install -U pip setuptools poetry
- name: Build package
run: |
poetry config repositories.testpypi https://test.pypi.org/legacy/
poetry config http-basic.testpypi ${{ secrets.TEST_PYPI_USER }} ${{ secrets.TEST_PYPI_PASS }}
poetry build
- name: Publish package
run: |
poetry publish -r testpypi
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019-2022 Ronie Martinez
Copyright (c) 2019 Ronie Martinez

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.PHONY: install
install:
pip3 install -U pip setuptools wheel poetry
pip3 install -U pip setuptools poetry
poetry install

.PHONY: install-actions
install-actions:
pip3 install pip setuptools wheel poetry
pip3 install pip setuptools poetry
poetry config virtualenvs.create false
poetry config experimental.new-installer false
poetry install
Expand Down Expand Up @@ -35,5 +35,6 @@ setup:

.PHONY: tag
tag:
VERSION=`poetry version | grep -o -E "\d+\.\d+\.\d+"`; \
git tag -s -a $$VERSION -m "Release $$VERSION"
VERSION=`poetry version | grep -o -E "\d+\.\d+\.\d+(-\w+\.\d+)?"`; \
git tag -s -a $$VERSION -m "Release $$VERSION"; \
echo "Tagged $$VERSION";
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# amortization

Python library for calculating amortizations and generating amortization schedules
<table>
<tr>
<td>License</td>
Expand Down Expand Up @@ -28,10 +25,9 @@ Python library for calculating amortizations and generating amortization schedul
</tr>
</table>

## Support
If you like `amortization` or if it is useful to you, show your support by sponsoring my projects.
# amortization

[![Github Sponsors](https://img.shields.io/github/sponsors/roniemartinez?label=github%20sponsors&logo=github%20sponsors&style=for-the-badge)](https://github.com/sponsors/roniemartinez)
Python library for calculating amortizations and generating amortization schedules

## Installation

Expand Down
17 changes: 3 additions & 14 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@

amortization
============

Python library for calculating amortizations and generating amortization schedules


.. raw:: html

Expand Down Expand Up @@ -35,16 +30,10 @@ Python library for calculating amortizations and generating amortization schedul
</table>


Support
-------

If you like ``amortization`` or if it is useful to you, show your support by sponsoring my projects.


.. image:: https://img.shields.io/github/sponsors/roniemartinez?label=github%20sponsors&logo=github%20sponsors&style=for-the-badge
:target: https://github.com/sponsors/roniemartinez
:alt: Github Sponsors
amortization
============

Python library for calculating amortizations and generating amortization schedules

Installation
------------
Expand Down
Loading

0 comments on commit b957525

Please sign in to comment.