-
-
Notifications
You must be signed in to change notification settings - Fork 30
49 lines (40 loc) · 1.4 KB
/
generate_pocket_firmware_details.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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