diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..8bfbfed --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,33 @@ +name: Main + +on: + push: + branches: + - main + workflow_run: + workflows: [ Lint ] + types: + - completed + +jobs: + main: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install pyinstaller + - name: Build + run: | + pyinstaller --onefile sgpt.py + - name: Release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: dist/sgpt + tag: ${{ github.ref }} + overwrite: true diff --git a/pre-push.sh b/pre-push.sh index 770043f..490b053 100755 --- a/pre-push.sh +++ b/pre-push.sh @@ -38,4 +38,4 @@ else exit 1 fi -echo 'Well done.' \ No newline at end of file +echo 'Well done.' diff --git a/sgpt.py b/sgpt.py index 04a3e7e..c431819 100644 --- a/sgpt.py +++ b/sgpt.py @@ -57,7 +57,7 @@ def openai_request(prompt, model, max_tokens, api_key): "model": model, "max_tokens": max_tokens, } - response = requests.post(API_URL, headers=headers, json=data, timeout=5) + response = requests.post(API_URL, headers=headers, json=data, timeout=180) response.raise_for_status() return response.json()["choices"][0]["text"]