Generate Pocket Firmware Details #4266
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 Pocket Firmware Details | |
on: | |
schedule: | |
- cron: "0 */2 * * *" | |
workflow_dispatch: | |
jobs: | |
generate: | |
runs-on: ubuntu-22.04 | |
outputs: | |
changed: ${{ steps.generate_step.outputs.changed }} | |
sha: ${{ steps.generate_step.outputs.sha }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
- run: pip install -r .github/requirements.txt | |
- name: Generate Pocket Firmware Version file | |
id: generate_step | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "The CI/CD Bot" | |
cd src | |
python3 generate_pocket_firmware_details.py | |
git add update_all/analogue_pocket/pocket_firmware_details.py | |
if git diff --staged --exit-code; then | |
echo "No need to change anything." | |
echo "changed=false" >> $GITHUB_OUTPUT | |
echo "sha=" >> $GITHUB_OUTPUT | |
else | |
git commit -m "BOT: Analogue Pocket firmware details updated" | |
git push | |
echo "Changes committed and pushed, build needs to be triggered." | |
echo "changed=true" >> $GITHUB_OUTPUT | |
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | |
fi | |
trigger_build: | |
needs: generate | |
if: ${{ needs.generate.outputs.changed == 'true' }} | |
uses: theypsilon/Update_All_MiSTer/.github/workflows/build.yml@master |