|
23 | 23 | description: 'your commit message' |
24 | 24 | required: true |
25 | 25 | default: 'TWRP device tree' |
26 | | - IMG_TYPE: |
27 | | - description: 'your img type' |
| 26 | + PUSH_GITHUB: |
| 27 | + description: 'Push to GitHub Repository.' |
| 28 | + type: boolean |
28 | 29 | required: true |
29 | | - default: 'recovery' |
30 | | - type: choice |
31 | | - options: |
32 | | - - boot |
33 | | - - recovery |
34 | | - - vendor_boot |
| 30 | + default: false |
35 | 31 | RELEASE_FILE: |
36 | 32 | description: 'Upload file to GitHub Release too.' |
37 | 33 | type: boolean |
@@ -59,23 +55,40 @@ jobs: |
59 | 55 | - name: Downloading .img file |
60 | 56 | run: | |
61 | 57 | wget ${{ github.event.inputs.DEVICE_IMG }} |
| 58 | + if [ -f ./recovery.img ]; then |
| 59 | + echo "RECOVERY_TYPE=recovery" >> $GITHUB_ENV |
| 60 | + echo "recovery.img file found!" |
| 61 | + elif [ -f ./boot.img ]; then |
| 62 | + echo "RECOVERY_TYPE=boot" >> $GITHUB_ENV |
| 63 | + echo "boot.img file found!" |
| 64 | + elif [ -f ./vendor_boot.img ]; then |
| 65 | + echo "RECOVERY_TYPE=vendor_boot" >> $GITHUB_ENV |
| 66 | + echo "vendor_boot.img file found!" |
| 67 | + else |
| 68 | + echo "No Recovery file found!" |
| 69 | + cd Exit |
| 70 | + fi |
62 | 71 | |
63 | 72 | - name: Generating Device tree |
64 | 73 | run: | |
65 | | - python3 -m twrpdtgen ./${{ github.event.inputs.IMG_TYPE }}.img |
| 74 | + python3 -m twrpdtgen ./${{ env.RECOVERY_TYPE }}.img |
66 | 75 | |
67 | 76 | - name: Set Build Date |
68 | 77 | run: | |
69 | 78 | echo "BUILD_DATE=$(date +%Y%m%d)" >> $GITHUB_ENV |
70 | 79 |
|
71 | | - - name: Add to Zip |
| 80 | + - name: getting device information |
72 | 81 | run: | |
73 | 82 | mv ./output/ device |
74 | | - zip -r ${{ env.DEVICE_ID }}_${{ env.DEVICE_IDD }}_tree.zip ./device/ |
75 | 83 | cd device/*/ |
76 | 84 | echo "DEVICE_ID=${PWD##*/}" >> $GITHUB_ENV |
77 | 85 | cd * |
78 | 86 | echo "DEVICE_IDD=${PWD##*/}" >> $GITHUB_ENV |
| 87 | +
|
| 88 | + - name: Add to Zip |
| 89 | + run: | |
| 90 | + zip -r ${{ env.DEVICE_ID }}_${{ env.DEVICE_IDD }}_tree.zip ./device/ |
| 91 | + |
79 | 92 | - name: Release |
80 | 93 | if: github.event.inputs.RELEASE_FILE == 'true' |
81 | 94 | uses: softprops/action-gh-release@v1 |
|
87 | 100 | body: | |
88 | 101 |
|
89 | 102 | - name: Push to GitHub |
| 103 | + if: github.event.inputs.PUSH_GITHUB == 'true' |
90 | 104 | run: | |
91 | 105 | git config --global user.email "Samuel Kendall" |
92 | 106 | git config --global user.name "[email protected]" |
|
0 commit comments