Skip to content

Commit

Permalink
- Improve the Github Action that updates the Cask.
Browse files Browse the repository at this point in the history
- Handle 'grep' is not recognized as an internal or external command error.
  • Loading branch information
badabing2005 committed Aug 30, 2024
1 parent 5e80871 commit bffe620
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 16 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/update-homebrew-cask.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
tags:
description: 'Build tags'
tag:
description: 'Build tag'
required: false

jobs:
update-cask:
if: github.actor == 'badabing2005'
runs-on: ubuntu-latest

steps:
Expand All @@ -64,9 +66,18 @@ jobs:
git clone https://github.com/badabing2005/homebrew-PixelFlasher.git
cd homebrew-PixelFlasher
- name: Determine tag name
id: determine-tag
run: |
if [ -n "${{ github.event.inputs.tag }}" ]; then
echo "TAG_NAME=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
else
echo "TAG_NAME=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
fi
- name: Check if DMG file exists
run: |
if ! curl -L --fail "https://github.com/badabing2005/PixelFlasher/releases/download/${{ github.event.release.tag_name }}/PixelFlasher.dmg" -o PixelFlasher.dmg; then
if ! curl -L --fail "https://github.com/badabing2005/PixelFlasher/releases/download/${{ env.TAG_NAME }}/PixelFlasher.dmg" -o PixelFlasher.dmg; then
echo "Error: DMG file not found. Exiting."
exit 1
fi
Expand All @@ -75,7 +86,7 @@ jobs:
ls -lR
- name: Strip leading 'v' from tag name
run: echo "TAG_NAME=${{ github.event.release.tag_name }}" | sed 's/^v//g' >> $GITHUB_ENV
run: echo "TAG_NAME=${{ env.TAG_NAME }}" | sed 's/^v//g' >> $GITHUB_ENV

- name: Update Cask version
run: |
Expand All @@ -95,6 +106,6 @@ jobs:
if git diff --cached --quiet; then
echo "No changes to commit."
else
git commit -m "Update PixelFlasher to version ${{ github.event.release.tag_name }}"
git commit -m "Update PixelFlasher to version v${{ env.TAG_NAME }}"
git push origin main
fi
2 changes: 1 addition & 1 deletion build-on-mac.spec
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ exe = EXE(pyz,
icon='images/icon-dark-256.icns')
app = BUNDLE(exe,
name='PixelFlasher.app',
version='7.4.2.1',
version='7.4.2.2',
icon='./images/icon-dark-256.icns',
bundle_identifier='com.badabing.pixelflasher')
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# <https://www.gnu.org/licenses/>.

rm -rf build dist
VERSION=7.4.2.1
VERSION=7.4.2.2
NAME="PixelFlasher"
DIST_NAME="PixelFlasher"

Expand Down
2 changes: 1 addition & 1 deletion constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

APPNAME = 'PixelFlasher'
CONFIG_FILE_NAME = 'PixelFlasher.json'
VERSION = '7.4.2.1'
VERSION = '7.4.2.2'
SDKVERSION = '33.0.3'
MAIN_WIDTH = 1400
MAIN_HEIGHT = 1040
Expand Down
2 changes: 1 addition & 1 deletion modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -1756,7 +1756,7 @@ def manual_magisk(self, boot_file_name):
print("Aborting ...")
return -1
# find the newly created file and return
theCmd = f"\"{get_adb()}\" -s {device.id} shell ls -t {self.config.phone_path}/magisk_patched-* | head -1"
theCmd = f"\"{get_adb()}\" -s {device.id} shell \"ls -t {self.config.phone_path}/magisk_patched-* | head -1\""
res = run_shell(theCmd)
if res and isinstance(res, subprocess.CompletedProcess) and res.returncode == 0 and res.stderr == '':
return os.path.basename(res.stdout.strip())
Expand Down
4 changes: 2 additions & 2 deletions phone.py
Original file line number Diff line number Diff line change
Expand Up @@ -2219,7 +2219,7 @@ def get_config_kallsyms(self):
if self.mode != 'adb':
return
try:
theCmd = f"\"{get_adb()}\" -s {self.id} shell zcat /proc/config.gz | grep -w CONFIG_KALLSYMS"
theCmd = f"\"{get_adb()}\" -s {self.id} shell \"zcat /proc/config.gz | grep -w CONFIG_KALLSYMS\""
res = run_shell(theCmd)
if res and isinstance(res, subprocess.CompletedProcess) and res.returncode == 0:
return res.stdout.strip('\n')
Expand Down Expand Up @@ -2251,7 +2251,7 @@ def get_config_kallsyms_all(self):
if self.mode != 'adb':
return
try:
theCmd = f"\"{get_adb()}\" -s {self.id} shell zcat /proc/config.gz | grep -w CONFIG_KALLSYMS_ALL"
theCmd = f"\"{get_adb()}\" -s {self.id} shell \"zcat /proc/config.gz | grep -w CONFIG_KALLSYMS_ALL\""
res = run_shell(theCmd)
if res and isinstance(res, subprocess.CompletedProcess) and res.returncode == 0:
return res.stdout.strip('\n')
Expand Down
2 changes: 1 addition & 1 deletion windows-metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# https://github.com/DudeNr33/pyinstaller-versionfile
# create-version-file windows-metadata.yaml --outfile windows-version-info.txt
Version: 7.4.2.1
Version: 7.4.2.2
FileDescription: PixelFlasher
InternalName: PixelFlasher
OriginalFilename: PixelFlasher.exe
Expand Down
8 changes: 4 additions & 4 deletions windows-version-info.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ VSVersionInfo(
ffi=FixedFileInfo(
# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
# Set not needed items to zero 0. Must always contain 4 elements.
filevers=(7,4,2,1),
prodvers=(7,4,2,1),
filevers=(7,4,2,2),
prodvers=(7,4,2,2),
# Contains a bitmask that specifies the valid bits 'flags'r
mask=0x3f,
# Contains a bitmask that specifies the Boolean attributes of the file.
Expand All @@ -32,12 +32,12 @@ VSVersionInfo(
u'040904B0',
[StringStruct(u'CompanyName', u''),
StringStruct(u'FileDescription', u'PixelFlasher'),
StringStruct(u'FileVersion', u'7.4.2.1'),
StringStruct(u'FileVersion', u'7.4.2.2'),
StringStruct(u'InternalName', u'PixelFlasher'),
StringStruct(u'LegalCopyright', u''),
StringStruct(u'OriginalFilename', u'PixelFlasher.exe'),
StringStruct(u'ProductName', u'PixelFlasher'),
StringStruct(u'ProductVersion', u'7.4.2.1')])
StringStruct(u'ProductVersion', u'7.4.2.2')])
]),
VarFileInfo([VarStruct(u'Translation', [1033, 1200])])
]
Expand Down

0 comments on commit bffe620

Please sign in to comment.