Update version #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update version | |
on: | |
workflow_dispatch: # This allows the workflow to be triggered manually. | |
jobs: | |
build_and_deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install PDM | |
run: | | |
python3 -m pip install pdm | |
pdm add setuptools | |
pdm import setup.py | |
# - name: Update ROS & ROS 2 Interface Versions (added to separate repositories, therefore, this is not needed) | |
# run: | | |
# VERSION=$(grep -oP '(?<=version = ")[^"]+' pyproject.toml) | |
# if [[ -z "$VERSION" ]]; then | |
# echo "Failed to extract version from pyproject.toml" | |
# exit 1 | |
# fi | |
# sed -i.bak -E "s|<version>[^<]+</version>|<version>$VERSION</version>|" wrapyfi_extensions/wrapyfi_ros2_interfaces/package.xml | |
# sed -i.bak -E "s|<version>[^<]+</version>|<version>$VERSION</version>|" wrapyfi_extensions/wrapyfi_ros_interfaces/package.xml | |
- name: Refactor with Code Black | |
run: | | |
python3 -m pip install black | |
black . | |
- name: Generate Documentation | |
run: | | |
cd docs | |
python3 -m pip install -r requirements.txt | |
./build_docs.sh | |
cd ../ | |
- name: Prepare PyPI-specific README | |
run: | | |
cp README.md README.pypi.md | |
sed -i 's|<sub style="white-space: pre-wrap;">|<div style="white-space: pre-wrap; font-family: monospace;">|g' README.pypi.md | |
sed -i 's|</sub>|</div>|g' README.pypi.md | |
- name: Build package | |
run: | | |
rm -rf dist | |
python3 -m pip install --upgrade build | |
mv README.pypi.md README.md | |
python3 -m build | |
git checkout -- README.md | |
- name: Configure Git | |
run: | | |
git config --global user.name "GitHub Actions Bot" | |
git config --global user.email "[email protected]" | |
- name: Commit and Push Changes | |
run: | | |
git checkout -b bot_version_bump | |
git add -A | |
git commit -m "Automated version bump and other updates" | |
git push origin bot_version_bump | |
- name: Upload to PyPI | |
env: | |
PYPI_USERNAME: __token__ # Your PyPI token username | |
PYPI_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} # Your PyPI token, stored as a GitHub secret | |
run: | | |
python3 -m pip -vvv install --upgrade --force-reinstall cffi | |
python3 -m pip install --upgrade twine | |
python3 -m twine upload dist/* --username $PYPI_USERNAME --password $PYPI_PASSWORD |