Skip to content

Commit

Permalink
fix #226, use CI for packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
c0fec0de committed Oct 10, 2023
1 parent 510f543 commit 42771d6
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 6 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: Python
name: test

on: [push]
on: [push, pull_request, release]

jobs:
test:
build:

strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
Expand All @@ -19,8 +20,6 @@ jobs:
python -m pip install --upgrade pip
sudo apt-get install -y graphviz
pip install tox "poetry>=1.4" coveralls
git --version
git submodule --help
- name: TOX
run: tox
- name: Upload coverage data to coveralls.io
Expand All @@ -32,7 +31,7 @@ jobs:

coveralls:
name: Indicate completion to coveralls.io
needs: test
needs: build
runs-on: ubuntu-latest
container: python:3-slim
steps:
Expand All @@ -42,3 +41,14 @@ jobs:
coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish:
if: github.event_name == 'push' && github.ref_type == 'tag'
needs: coveralls
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build and publish to pypi
uses: JRubics/[email protected]
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
63 changes: 63 additions & 0 deletions CONTRIBUTE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Contribute

## Branches

* `2.x.x` main line for 2.x.x
* `3.x.x` actual main line
* documentation links refer to `3.x.x`
* `main`
* documentation links refer to `latest`

## Testing

### Create Environment

Run these commands just the first time:

```bash
# Ensure python3 is installed
python3 -m venv .venv
source .venv/bin/activate
pip install tox "poetry>=1.4" "crashtest==0.4.1"
```

### Enter Environment

Run this command once you open a new shell:

```bash
source .venv/bin/activate
```

### Test Your Changes

```bash
# test
tox
```

### Release

```bash
git pull

prev_version=$(poetry version -s)

# Version Bump
poetry version minor
# OR
poetry version patch

# Commit, Tag and Push
version=$(poetry version -s)

sed "s/$prev_version/$version/g" -i README.rst
sed "s/$prev_version/$version/g" -i docs/index.rst

git commit -m"version bump to ${version}" pyproject.toml README.rst docs/index.rst
git tag "${version}" -m "Release ${version}"
git push
git push --tags

# Publishing is handled by CI
```

0 comments on commit 42771d6

Please sign in to comment.