2021-02-09 00:24:34 +00:00
|
|
|
name: Publish package
|
|
|
|
# Publish to PyPI when new release on GitHub, if tests pass
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [created]
|
|
|
|
workflow_dispatch:
|
|
|
|
# Manual trigger in case the release needs to be rerun
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
2021-02-09 14:21:53 +00:00
|
|
|
tests:
|
2023-07-10 06:11:51 +00:00
|
|
|
uses: LibreTranslate/LibreTranslate/.github/workflows/run-tests.yml@main
|
|
|
|
secrets: inherit
|
2021-02-09 00:24:34 +00:00
|
|
|
|
2022-05-03 09:09:55 +00:00
|
|
|
|
2021-02-09 00:24:34 +00:00
|
|
|
publish:
|
2021-02-09 14:21:53 +00:00
|
|
|
needs: [ tests ]
|
2021-02-09 00:24:34 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2023-10-19 19:26:57 +00:00
|
|
|
- uses: actions/checkout@v4
|
2021-02-09 00:24:34 +00:00
|
|
|
- name: Set up Python
|
2023-12-06 16:07:07 +00:00
|
|
|
uses: actions/setup-python@v5
|
2021-02-09 00:24:34 +00:00
|
|
|
with:
|
2021-02-09 13:12:32 +00:00
|
|
|
python-version: '3.8'
|
2021-02-09 00:24:34 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2023-07-10 06:46:37 +00:00
|
|
|
pip install build
|
2021-02-09 00:24:34 +00:00
|
|
|
|
2023-07-10 06:11:51 +00:00
|
|
|
- name: Build
|
2021-02-09 00:24:34 +00:00
|
|
|
run: |
|
2023-02-01 22:44:45 +00:00
|
|
|
pip install Babel==2.11.0
|
2023-01-12 13:23:43 +00:00
|
|
|
python scripts/compile_locales.py
|
2023-07-10 06:11:51 +00:00
|
|
|
python -m build
|
|
|
|
|
|
|
|
- name: Publish to PyPI
|
|
|
|
uses: pypa/gh-action-pypi-publish@release/v1
|
|
|
|
with:
|
|
|
|
user: ${{ secrets.PYPI_USERNAME }}
|
|
|
|
password: ${{ secrets.PYPI_PASSWORD }}
|