Skip to content

Commit

Permalink
Merge pull request #181 from jsocol/automate-release
Browse files Browse the repository at this point in the history
Automate Releases
  • Loading branch information
jsocol committed Dec 4, 2022
2 parents a6084e9 + 47d6cf8 commit 3fa4353
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 13 deletions.
23 changes: 23 additions & 0 deletions .github/actions/test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: test
description: 'runs a test matrix'
inputs:
python-version:
required: true

runs:
using: "composite"
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}

- run: pip install --upgrade pip
shell: sh

- run: pip install tox
shell: sh

- run: tox -e py
shell: sh
28 changes: 15 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,21 @@ jobs:
python: ['3.7', '3.8', '3.9', '3.10', '3.11', 'pypy-3.9']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- run: pip install --upgrade pip
- run: pip install tox
- run: tox -e py
- uses: actions/checkout@v3

- uses: ./.github/actions/test
with:
python-version: ${{ matrix.python }}

lint:
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- run: pip install flake8
- run: flake8 statsd
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: '3.11'

- run: pip install flake8

- run: flake8 statsd
49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: release

on:
push:
tags:
- v*

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v3

- uses: ./.github/actions/test
with:
python-version: ${{ matrix.python-version }}

release:
runs-on: ubuntu-latest
needs: [test]
steps:

- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11

- name: install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: build
run: ./run.sh build

- name: check
run: ./run.sh check

- name: release
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_DEPLOY_TOKEN }}

0 comments on commit 3fa4353

Please sign in to comment.