Merge pull request #110 from LaggAt/alpha #399
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# test and publish to Pypi on checkin | |
name: tasks | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: [3.7, 3.8, 3.9] | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox tox-gh-actions | |
- name: Test with tox | |
run: tox | |
bump-alpha: | |
needs: test | |
if: | | |
!contains(github.event.head_commit.message, 'bump:') && | |
(github.event_name == 'push' || github.event_name == 'workflow_dispatch') && | |
github.ref == 'refs/heads/alpha' | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.x'] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
token: '${{ secrets.PERSONAL_ACCESS_TOKEN }}' | |
fetch-depth: 0 | |
ref: ${{ github.ref }} | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python --version | |
python -m pip install -U commitizen | |
- name: Create bump | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
cz bump --yes --increment PATCH | |
- name: Push changes | |
uses: Woile/github-push-action@master | |
with: | |
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
tags: "true" | |
branch: ${{ github.ref }} | |
bump-beta: | |
needs: test | |
if: | | |
!contains(github.event.head_commit.message, 'bump:') && | |
(github.event_name == 'push' || github.event_name == 'workflow_dispatch') && | |
github.ref == 'refs/heads/beta' | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.x'] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
token: '${{ secrets.PERSONAL_ACCESS_TOKEN }}' | |
fetch-depth: 0 | |
ref: ${{ github.ref }} | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python --version | |
python -m pip install -U commitizen | |
- name: Create bump | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
cz bump --yes --increment MINOR | |
- name: Push changes | |
uses: Woile/github-push-action@master | |
with: | |
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
tags: "true" | |
branch: ${{ github.ref }} | |
bump-stable: | |
needs: test | |
if: | | |
!contains(github.event.head_commit.message, 'bump:') && | |
(github.event_name == 'push' || github.event_name == 'workflow_dispatch') && | |
github.ref == 'refs/heads/stable' | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.x'] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
token: '${{ secrets.PERSONAL_ACCESS_TOKEN }}' | |
fetch-depth: 0 | |
ref: ${{ github.ref }} | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python --version | |
python -m pip install -U commitizen | |
- name: Create bump | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
cz bump --yes --increment MAJOR | |
- name: Push changes | |
uses: Woile/github-push-action@master | |
with: | |
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
tags: "true" | |
branch: ${{ github.ref }} | |
deploy: | |
needs: test | |
if: | | |
contains(github.event.head_commit.message, 'bump:') && | |
github.event_name == 'push' && | |
(github.ref == 'refs/heads/alpha' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/stable') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools wheel twine | |
- name: Build and publish | |
env: | |
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
run: | | |
python setup.py install sdist bdist_wheel | |
twine upload dist/* |