Skip to content

Commit

Permalink
CI: add CI for tool build
Browse files Browse the repository at this point in the history
  • Loading branch information
cnlancehu committed Jan 26, 2023
1 parent 55db806 commit 520a645
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 5 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Build

on:
workflow_dispatch:
inputs:
version:
description: "Version"
required: true
type: string

permissions:
contents: read

jobs:
build_on_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip3 install pyinstaller
pip3 install requests
pip3 install tencentcloud-sdk-python
- name: Build
run: |
python3 -m PyInstaller main.py -F -i icon.ico
mv dist/main dist/qcip
mv config.json dist/config.json
- name: Upload
uses: actions/[email protected]
with:
name: qcip-${{ github.event.inputs.version }}-linux-x86_64
path: dist/*
build_on_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip3 install pyinstaller
pip3 install requests
pip3 install tencentcloud-sdk-python
pip3 install pillow
- name: Build
run: |
python3 -m PyInstaller main.py -F -i icon.ico
mv dist/main.exe dist/qcip.exe
mv config.json dist/config.json
- name: Upload
uses: actions/[email protected]
with:
name: qcip-${{ github.event.inputs.version }}-windows-x86_64
path: dist/*
build_on_macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip3 install pyinstaller
pip3 install requests
pip3 install tencentcloud-sdk-python
- name: Build
run: |
python3 -m PyInstaller main.py -F -i icon.ico
mv dist/main dist/qcip
mv config.json dist/config.json
- name: Upload
uses: actions/[email protected]
with:
name: qcip-${{ github.event.inputs.version }}-macos-x86_64
path: dist/*
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,23 @@
通过腾讯云的API以获取服务器的安全组信息,将服务器指定防火墙策略的**来源**设置为你的IP,使服务器的重要端口只能被开您的ip访问。

## 食用教程
### 环境要求
### 方法一 直接下载可执行文件(推荐)
[Releases](https://github.com/cnlancehu/qcliteautorip/releases)中下载适合你的系统的可执行文件,解压后,请直接跳转到[更改配置文件](#更改配置文件)步骤

### 方法二 使用Python运行
**环境要求**
> Python 3.6+ (仅在Python3.9 3.10上测试过)
必要的Python Module:

TencentSDK
```bash
pip install tencentcloud-sdk-python
pip3 install tencentcloud-sdk-python
```

Requests
```bash
pip install requests
pip3 install requests
```

### 更改配置文件
Expand Down Expand Up @@ -63,8 +67,11 @@ pip install requests
```

### 运行脚本
若你使用的是**方法一**,现在你可以直接运行可执行文件了

若你采用的是**方法二**,请使用以下脚本运行
```bash
python main.py
python3 main.py
```
这样,脚本就可以自动获取你的ip,并将指定防火墙策略的来源限制为你的ip

Expand All @@ -82,8 +89,9 @@ python main.py

```vbs
// qclarip.vbs
// 该脚本适用于方法二如果你使用的是方法一请适当修改后使用
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "cmd /c python /*程序的地址*/", 0, False
WshShell.Run "cmd /c python3 /*程序的地址*/", 0, False
```


Expand Down
Binary file added icon.ico
Binary file not shown.

0 comments on commit 520a645

Please sign in to comment.