Skip to content

Commit

Permalink
actions: add automatic publish version
Browse files Browse the repository at this point in the history
Co-Authored-by: Johnny Mariéthoz <[email protected]>
  • Loading branch information
jma committed May 21, 2024
1 parent 2de7bda commit 5d1f643
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
32 changes: 19 additions & 13 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@
name: Publish

on:
pull_request:
branches:
- *
push:
branches:
- main
- staging
tags:
- v*

Expand All @@ -28,21 +34,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7

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

- name: Install Poetry
uses: snok/install-poetry@v1

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel babel
- name: Build package
poetry install
- name: poetry-publish
run: |
python setup.py compile_catalog sdist bdist_wheel
- name: pypi-publish
uses: pypa/[email protected]
with:
user: __token__

password: ${{ secrets.pypi_token }}

echo "${{ secrets.PYPI_TOKEN }}"
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
poetry publish --build --dry-run
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ on:
pull_request:
branches:
- main
- "staging"
- staging
schedule:
# * is a special character in YAML so you have to quote this string
- cron: "0 3 * * 6"
Expand Down Expand Up @@ -79,4 +79,4 @@ jobs:
poetry run ./run-tests.sh
- name: Run build
run: poetry build
run: poetry publish --build --dry-run

0 comments on commit 5d1f643

Please sign in to comment.