Skip to content

Commit

Permalink
Workflow & 1.0.0_commit7
Browse files Browse the repository at this point in the history
  • Loading branch information
WhatDamon committed Oct 3, 2023
1 parent 3f554bd commit e56aaa4
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 4 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/nuitka.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Nuitka

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:


jobs:
build:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]

runs-on: ${{ matrix.os }}

steps:
# Check-out repository
- uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified

# Build python script into a stand-alone exe
- name: Build
uses: actions/setup-python@v4
with:
script-name: main.py
onefile: true
low-memory: true
standalone: true
enable-console: true
access-token: ${{ secrets.NUITKA_COMMERCIAL_ACCESS_TOKEN }}
# macos-create-app-bundle: ${{ runner.os == 'macOS' }}

# Uploads artifacts
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ runner.os }} Build
path: |
build/*.exe
build/*.bin
build/*.app/**/*
29 changes: 29 additions & 0 deletions .github/workflows/pyinstaller.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Pyinstaller

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:


jobs:
pyinstaller-build:
runs-on: [macos-latest, ubuntu-latest, windows-latest]

steps:
- name: Create Executable
uses: sayyid5416/pyinstaller@v1
with:
python_ver: '3.10'
options: --F, --c

- name: "Upload Artifacts"
uses: actions/upload-artifact@v3
with:
name: ${{ runner.os }} Build
path: |
dist/*
8 changes: 4 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# 导入模块
import os, sys, urllib.request, zipfile, time, actions
from platform import platform, machine
from ctypes import windll
from pathlib import Path
from shutil import rmtree
from math import floor
Expand All @@ -19,10 +18,10 @@

# 主页面
def mainPageDescription():
print("\033[32m简易 ADB 脚本集\033[0m\n========================================\n本软件能够简化您通过 adb 来进行软件激活与安装的过程,\n软件正在开发当中, 目前为止有很多软件还不能通过本软件进行激活,\n软件可能还会存在一些严重的 BUG 需要后期修复!\n建议在激活或者安装软件前使用第一项功能验证是否成功连接上您的设备.\n\033[33m注意: 目前只支持 USB 调试模式! 使用该软件前请确保设备可以被识别, 搞机有风险, 请谨慎操作.\033[0m\n本软件使用 MIT 协议开源.\n版本: 1.0.0_commit6\n")
print("\033[32m简易 ADB 脚本集\033[0m\n========================================\n本软件能够简化您通过 adb 来进行软件激活与安装的过程,\n软件正在开发当中, 目前为止有很多软件还不能通过本软件进行激活,\n软件可能还会存在一些严重的 BUG 需要后期修复!\n建议在激活或者安装软件前使用第一项功能验证是否成功连接上您的设备.\n\033[33m注意: 目前只支持 USB 调试模式! 使用该软件前请确保设备可以被识别, 搞机有风险, 请谨慎操作.\033[0m\n本软件使用 MIT 协议开源.\n版本: 1.0.0_commit7\n")
print("\033[34mADB 主程序位置: \033[0m", AdbFullPath)
print("\033[34m运行系统平台: \033[0m", platform(), "-", os.name, "-", sys.platform, "-", machine(), "\n", sep = '')
mainPage()
mainPage()

# 启动选择项
def mainPage():
Expand Down Expand Up @@ -278,7 +277,7 @@ def moreOptionsDescription():

# 重启手机选择项
def moreOptions():
print("请选择: \n1. 查看 ADB 信息\n2. 重新下载 ADB\n2. 返回上级\n")
print("请选择: \n1. 查看 ADB 信息\n2. 重新下载 ADB\n3. 返回上级\n")
choice = input("请输入选项对应数字并回车(1~5): ")
if choice == "1":
print("\n")
Expand Down Expand Up @@ -453,6 +452,7 @@ def start():
if sys.platform.startswith('win'):
AdbPath = os.path.split(os.path.realpath(sys.argv[0]))[0] + "\\platform-tools"
AdbFullPath = AdbPath + "\\adb.exe"
from ctypes import windll
windll.kernel32.SetConsoleTitleW("简易 ADB 脚本集")
elif sys.platform.startswith('darwin') or sys.platform.startswith('linux'):
AdbPath = os.path.split(os.path.realpath(sys.argv[0]))[0] + "/platform-tools"
Expand Down

0 comments on commit e56aaa4

Please sign in to comment.