2024-06-20 12:36:12 +00:00
|
|
|
name: Publish to PyPI and update files
|
2024-02-18 20:40:03 +00:00
|
|
|
|
|
|
|
# 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
|
2024-06-20 12:36:12 +00:00
|
|
|
|
|
|
|
update_files:
|
|
|
|
name: Update schema.json, examples, and entry figures
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [publish]
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
|
|
|
|
- name: Set up Python 3.12
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: "3.12"
|
|
|
|
|
|
|
|
- name: Install Hatch
|
|
|
|
uses: pypa/hatch@install
|
|
|
|
|
|
|
|
- name: Set Git credentials
|
|
|
|
run: |
|
|
|
|
git config --global user.name "${{ github.actor }}"
|
|
|
|
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
|
|
|
|
|
|
|
|
- name: Update schema.json
|
|
|
|
run: |
|
|
|
|
hatch run docs:update-schema
|
|
|
|
git add schema.json
|
|
|
|
git commit -m "docs: update schema.json"
|
|
|
|
|
|
|
|
- name: Update `examples` folder
|
|
|
|
run: |
|
|
|
|
hatch run docs:update-examples
|
|
|
|
git add examples/*
|
|
|
|
git commit -m "docs: update examples"
|
|
|
|
|
|
|
|
- name: Update entry figures
|
|
|
|
run: |
|
|
|
|
hatch run docs:update-entry-figures
|
|
|
|
git add docs/assets/**/*.png
|
|
|
|
git commit -m "docs: update entry figures"
|
|
|
|
|
|
|
|
- name: Push changes
|
|
|
|
run: |
|
|
|
|
git push
|