forked from sq5bpf/uvk5-reverse-engineering
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
103 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
on: | ||
push: | ||
|
||
env: | ||
CHIRP_DIR: ${{github.workspace}}\temp\chirp | ||
BASH: C:\tools\cygwin\bin\bash | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
|
||
steps: | ||
|
||
- name: "Checkout repository" | ||
uses: actions/checkout@v3 | ||
|
||
- name: "Install Python" | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.9' | ||
cache: 'pip' | ||
cache-dependency-path: 'chirp\requirements-dev.txt' | ||
|
||
- name: "Instal Python packages" | ||
run: pip install -r chirp\requirements-dev.txt | ||
|
||
- name: "Install Cygwin" | ||
uses: egor-tensin/setup-cygwin@v4 | ||
with: | ||
packages: make gettext | ||
|
||
- name: "Prepare CHIRP repository" | ||
run: > | ||
New-Item -ItemType Directory -Force -Path temp && | ||
cd temp && | ||
git clone https://github.com/kk7ds/chirp.git && | ||
Copy-Item -Path "${{github.workspace}}\chirp\Makefile" -Destination "${{env.CHIRP_DIR}}\chirp\locale\" -Force && | ||
Copy-Item -Path "${{github.workspace}}\chirp\chirp.patch" -Destination "${{env.CHIRP_DIR}}\" -Force && | ||
Copy-Item -Path "${{github.workspace}}\chirp\setupCxFreeze.py" -Destination "${{env.CHIRP_DIR}}\" -Force && | ||
Copy-Item -Path "${{github.workspace}}\uvk5_egzumer.py" -Destination "${{env.CHIRP_DIR}}\chirp\drivers\" -Force && | ||
cd chirp && | ||
git apply chirp.patch; | ||
if ("${{github.ref}}" -like "refs/tags/v*") { | ||
$content = Get-Content -Path "chirp\__init__.py" -Raw; | ||
$content = $content -replace 'CHIRP_VERSION = "py3dev"', "CHIRP_VERSION = `"${{github.ref_name}}`""; | ||
Set-Content -Path "chirp\__init__.py" -Value $content; | ||
} | ||
- name: "Build CHIRP locale" | ||
run: > | ||
${{env.BASH}} --login -c "cd '${{env.CHIRP_DIR}}\chirp\locale'; make" && | ||
${{env.BASH}} --login -c "cd '${{env.CHIRP_DIR}}'; find chirp/locale/ -maxdepth 1 -type f -delete" | ||
- name: "Build CHIRP" | ||
run: > | ||
cd "${{env.CHIRP_DIR}}"; | ||
python setupCxFreeze.py build; | ||
cd build; | ||
Get-ChildItem -Directory -Filter 'exe.win*' | ForEach-Object { Rename-Item $_.FullName -NewName 'bin' }; | ||
New-Item -ItemType SymbolicLink -Path CHIRP.exe -Target bin\CHIRP_egzumer.exe; | ||
cd ..; | ||
ren build CHIRP_egzumer; | ||
Compress-Archive CHIRP_egzumer\ CHIRP_egzumer.zip | ||
- name: 'Upload Artifact' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: CHIRP_egzumer | ||
path: ${{env.CHIRP_DIR}}\CHIRP_egzumer.zip | ||
|
||
- name: Upload onefile to release | ||
if: ${{ startsWith(github.ref, 'refs/tags/v') }} | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: ${{env.CHIRP_DIR}}\CHIRP_egzumer.zip | ||
asset_name: CHIRP_egzumer.zip | ||
tag: ${{ github.ref }} | ||
overwrite: true | ||
release_name: release ${{ github.ref_name }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,5 @@ pyserial | |
requests | ||
yattag | ||
wheel | ||
importlib-resources | ||
importlib-resources | ||
cx_Freeze |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from cx_Freeze import setup, Executable | ||
|
||
# Dependencies are automatically detected, but it might need | ||
# fine tuning. | ||
build_options = { | ||
'packages': ['chirp.drivers'], | ||
'excludes': [] | ||
} | ||
|
||
import sys | ||
base = 'Win32GUI' if sys.platform=='win32' else None | ||
|
||
executables = [ | ||
Executable('chirpwx.py', base=base, target_name = 'CHIRP_egzumer', icon = 'chirp/share/chirp.ico') | ||
] | ||
|
||
setup(name='CHIRP egzumer', | ||
version = '0.7', | ||
description = 'modfied CHIRP with UV-K5 egzumer firmware driver', | ||
options = {'build_exe': build_options}, | ||
executables = executables) |