Skip to content

Commit

Permalink
Add workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
jepler committed Mar 12, 2023
1 parent 9f10b90 commit 23433e4
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# SPDX-FileCopyrightText: 2021 Jeff Epler
#
# SPDX-License-Identifier: MIT

name: Release chap

on:
release:
types: [published]

jobs:
release:

runs-on: ubuntu-22.04
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"

- uses: actions/checkout@v3

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

- name: Install deps
run: |
python -mpip install wheel
python -mpip install -r requirements-dev.txt
- name: Test
run: make coverage

- name: Build release
run: python -mbuild

- name: Upload release
run: twine upload -u "$TWINE_USERNAME" -p "$TWINE_PASSWORD" dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.pypi_token }}
56 changes: 56 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# SPDX-FileCopyrightText: 2021 Jeff Epler
#
# SPDX-License-Identifier: MIT

name: Test

on:
push:
pull_request:
release:
types: [published]
check_suite:
types: [rerequested]

jobs:
pre-commit:
runs-on: ubuntu-22.04
steps:

- uses: actions/checkout@v3

- name: pre-commit
uses: pre-commit/[email protected]

- name: Make patch
if: failure()
run: git diff > ~/pre-commit.patch

- name: Upload patch
if: failure()
uses: actions/upload-artifact@v3
with:
name: patch
path: ~/pre-commit.patch

test-release:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

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

- name: install deps
run: pip install -r requirements-dev.txt

- name: Build release
run: python -mbuild

- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/*
7 changes: 7 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# SPDX-FileCopyrightText: 2023 Jeff Epler
#
# SPDX-License-Identifier: MIT

build
setuptools>=45
wheel

0 comments on commit 23433e4

Please sign in to comment.