Update Extension Hub #960
This file contains hidden or 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
| ## ------------------------------------------------------------------------------------------------- | |
| ## -- Project : MLPro - The integrative middleware framework for standardized machine learning | |
| ## -- Workflow: extension_hub.yml | |
| ## ------------------------------------------------------------------------------------------------- | |
| ## -- History : | |
| ## -- yyyy-mm-dd Ver. Auth. Description | |
| ## -- 2023-10 1.0.0 DA Creation | |
| ## -- 2024-10-09 2.0.0 DA Restructuring and introduction of PR-based processing | |
| ## -- 2024-10-16 2.1.0 DA Step 3: creation of virtual environment due to new security | |
| ## -- restrictions in Python 3.12 | |
| ## -- 2024-12-05 2.2.0 DA Changed name of tmp. branch to 'extension_hub_tmp' | |
| ## -- 2024-12-10 2.3.0 DA Update actions/checkout to v4 | |
| ## -- 2025-05-07 2.4.0 DA Stabilized step 2 | |
| ## ------------------------------------------------------------------------------------------------- | |
| name: Update Extension Hub | |
| on: | |
| schedule: | |
| - cron: '00 22 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| update-extension-hub: | |
| name: Update the MLPro extension hub | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Step 1 - Checkout code | |
| id: step1 | |
| uses: actions/checkout@v4 | |
| - name: Step 2 - Preparation | |
| id: step2 | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git checkout main | |
| git pull origin main | |
| git push origin --delete extension_hub_tmp || true | |
| git checkout -b extension_hub_tmp | |
| - name: Step 3 - Updates on the extension hub | |
| id: step3 | |
| run: | | |
| python3 -m venv venv | |
| source venv/bin/activate | |
| pip3 install PyGithub | |
| python3 ${GITHUB_WORKSPACE}/extensions/update_extension_hub.py ${{ secrets.EXTENSION_HUB_UPDATES }} ../doc/rtd/content/04_extensions/sub/ | |
| - name: Step 4 - Commit changes | |
| id: step4 | |
| run: | | |
| git add ${GITHUB_WORKSPACE}/doc/rtd/content/04_extensions/ | |
| git commit -m 'MLPro extension hub updated' | |
| continue-on-error: true | |
| - name: Step 5 - Pull/push changes | |
| id: step5 | |
| if: ${{ steps.step4.outcome == 'success' }} | |
| run: git push origin extension_hub_tmp | |
| - name: Step 6 - Create Pull Request | |
| id: step6 | |
| if: ${{ steps.step5.outcome == 'success' }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.EXTENSION_HUB_UPDATES }} | |
| run: gh pr create --title "Update Extension Hub" --body "This PR was created automatically." --head extension_hub_tmp --base main | |
| - name: Step 7 - Auto-Review Pull Request | |
| id: step7 | |
| if: ${{ steps.step6.outcome == 'success' }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.EXTENSION_HUB_REVIEW_DA }} | |
| run: gh pr review --approve extension_hub_tmp | |
| - name: Step 8 - Merge Pull Request | |
| id: step8 | |
| if: ${{ steps.step7.outcome == 'success' }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.EXTENSION_HUB_UPDATES }} | |
| run: gh pr merge --auto --delete-branch --merge | |