2024-02-18 20:40:03 +00:00
|
|
|
name: Publish to PyPI
|
|
|
|
|
|
|
|
# GitHub events that triggers the workflow:
|
|
|
|
on:
|
|
|
|
release:
|
2024-02-25 14:29:25 +00:00
|
|
|
types: [released, edited]
|
2024-02-18 20:40:03 +00:00
|
|
|
|
|
|
|
jobs:
|
2024-02-25 14:29:25 +00:00
|
|
|
call_tests_workflow:
|
2024-03-09 18:36:42 +00:00
|
|
|
name: Test
|
|
|
|
uses: ./.github/workflows/test.yaml
|
2024-02-18 20:40:03 +00:00
|
|
|
|
|
|
|
publish:
|
|
|
|
name: Publish to PyPI
|
2024-02-25 14:35:55 +00:00
|
|
|
needs: [call_tests_workflow]
|
2024-02-18 20:40:03 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
environment: release
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
id-token: write
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
2024-02-25 14:42:37 +00:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
|
2024-02-18 20:40:03 +00:00
|
|
|
- name: Set up Python 3.12
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: "3.12"
|
|
|
|
|
2024-06-19 11:42:59 +00:00
|
|
|
- name: Install Hatch
|
|
|
|
uses: pypa/hatch@install
|
|
|
|
|
2024-02-19 17:54:40 +00:00
|
|
|
- name: Check if the release tag matches the version
|
|
|
|
uses: samuelcolvin/check-python-version@v4.1
|
|
|
|
with:
|
|
|
|
version_file_path: rendercv/__init__.py
|
|
|
|
|
2024-02-18 20:40:03 +00:00
|
|
|
- name: Build
|
|
|
|
run: |
|
2024-06-19 11:34:05 +00:00
|
|
|
hatch build
|
2024-02-18 20:40:03 +00:00
|
|
|
|
|
|
|
- name: Upload package to PyPI
|
|
|
|
uses: pypa/gh-action-pypi-publish@release/v1
|