Add README generation #6
Workflow file for this run
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: Generate README | |
on: | |
push: | |
branches: | |
- add-readme-generation | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-tags: true | |
fetch-depth: 0 | |
- name: Configure git | |
run: | | |
git config --global url."https://x-oauth-basic:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository_owner }}".insteadOf https://github.com/${{ github.repository_owner }} | |
- id: get_python_version | |
name: Get Python version | |
run: | | |
set -euo pipefail | |
python_version=$(cat ${GITHUB_WORKSPACE}/.python-version) | |
echo "Python version: ${python_version}" | |
echo "python_version=$python_version" >> "$GITHUB_OUTPUT" | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ steps.get_python_version.outputs.python_version }} | |
- name: Setup pipenv | |
run: python -m pip install --upgrade pipenv wheel | |
- id: cache-pipenv | |
uses: actions/cache@v3 | |
with: | |
path: ~/.local/share/virtualenvs | |
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }} | |
- name: Install | |
if: steps.cache-pipenv.outputs.cache-hit != 'true' | |
run: make install_ci | |
- name: Generate README | |
run: | | |
echo ${GITHUB_REF##*/} | |
git branch main remotes/origin/main | |
git tag --merged main | |
pipenv run python scripts/generate_readme.py main | |
# make generate_readme branch=${GITHUB_REF##*/} | |
# - name: Commit and push README | |
# run: | | |
# set -euo pipefail | |
# git checkout -B bot/update-readme | |
# git add "${{ github.workspace }}/README.rst" | |
# git commit -m "Update README [skip ci]" | |
# git push --force-with-lease | |
- name: Commit, push and create pull request | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
branch: bot/update-readme | |
commit-message: Update README [skip ci] | |
title: Update README | |
token: ${{ secrets.BUILD_BOT_PAT }} |