Skip to content

Commit

Permalink
Merge pull request #12 from hugovk/autodeploy
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Dec 17, 2022
2 parents eedf153 + d5fda76 commit 5b2326d
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 28 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Deploy

on:
push:
branches:
- main
release:
types:
- published
workflow_dispatch:

jobs:
deploy:
if: github.repository_owner == 'hugovk'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
cache: pip
cache-dependency-path: pyproject.toml

- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U build twine wheel
- name: Build package
run: |
python -m build
twine check --strict dist/*
- name: Publish package to PyPI
if: github.event.action == 'published'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
36 changes: 8 additions & 28 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,18 @@
for all merges to `main`.
[![GitHub Actions status](https://github.com/hugovk/fino/workflows/Test/badge.svg)](https://github.com/hugovk/fino/actions)

- [ ] Update version:
- [ ] Edit release draft, adjust text if needed: https://github.com/hugovk/fino/releases

```bash
git checkout main
edit setup.py
```
- [ ] Check next tag is correct, amend if needed

- [ ] Commit and tag with the version number:
- [ ] Publish release

```bash
git add setup.py
git commit -m "Release 0.6.0"
git tag -a 0.6.0 -m "Release 0.6.0"
```
- [ ] Check the tagged
[GitHub Actions build](https://github.com/hugovk/fino/actions/workflows/deploy.yml)
has deployed to [PyPI](https://pypi.org/project/fino/#history)

- [ ] Create a distribution and release on PyPI:
- [ ] Check installation:

```bash
pip3 install -U pip setuptools wheel twine keyring
rm -rf build
python3 setup.py sdist --format=gztar bdist_wheel
twine check dist/fino-0.6.0*
twine upload -r pypi dist/fino-0.6.0*
pip3 uninstall -y fino && pip3 install -U fino && python3 -c "import fino; print(fino.to_finnish(123))"
```

- [ ] Check installation: `pip3 uninstall -y fino && pip install -U fino`
- [ ] Push commits and tags:

```bash
git push
git push --tags
```

- [ ] Create new GitHub release: https://github.com/hugovk/fino/releases/new
- Tag: Pick existing tag "0.6.0"

0 comments on commit 5b2326d

Please sign in to comment.