Repository navigation
99 lines (84 loc) · 3.55 KB
/
Copy pathbuild-executable.yml
File metadata and controls
99 lines (84 loc) · 3.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Build and Release Barebones Shell
on:
workflow_run:
workflows: ["Publish to PyPI"]
types:
- completed
workflow_dispatch:
inputs:
branch:
description: "Branch to use"
required: true
default: "main"
jobs:
run_on_windows_x64:
runs-on: Windows_x64_8cores
outputs:
version: ${{ steps.extract_version.outputs.version }}
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install dependencies and build x64 exe
id: extract_version
env:
BOT_REPO_ACCESS: ${{ secrets.BOT_REPO_ACCESS }}
run: |
echo "Verifying Python installation..."
python --version
$env:Path += ";c:\python312\Scripts"
$env:PYTHONUTF8 = 1
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade inductiva pyinstaller prompt_toolkit truststore
if ("${{ github.ref }}" -eq "refs/heads/main") {
$env:INDUCTIVA_API_KEY = "${{ secrets.API_TEST_KEY }}"
} else {
$env:INDUCTIVA_API_KEY = "${{ secrets.API_DEV_TEST_KEY }}"
$env:INDUCTIVA_API_URL = "https://api-dev.inductiva.ai"
}
cd barebones-shell
$file = "C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\inductiva\__init__.py"
(Get-Content $file) -replace '^_check_for_available_package_update\(\)', '#_check_for_available_package_update()' | Set-Content $file
# Extract version string from __init__.py
$version_line = Select-String -Path $file -Pattern '__version__\s*=\s*".*"' | Select-Object -First 1
$version = $version_line -replace '.*__version__\s*=\s*"(.*)".*', '$1'
echo "Extracted version: $version"
echo "VERSION=$version" >> $env:GITHUB_ENV
"version=$version" | Out-File -Encoding utf8 -Append -FilePath $env:GITHUB_OUTPUT
# Build with PyInstaller
pyinstaller barebones_shell.py --name "barebones_shell_x64_v$version" --icon=favicon.ico --additional-hooks-dir=. --onefile
- name: Upload x64 executable artifact
uses: actions/upload-artifact@v4
with:
name: barebones_shell_x64_v${{ env.VERSION }}
path: barebones-shell/dist/barebones_shell_x64_v${{ env.VERSION }}.exe
release:
needs: run_on_windows_x64
runs-on: ubuntu-latest
steps:
- name: Download x64 executable artifact
uses: actions/download-artifact@v4
with:
name: barebones_shell_x64_v${{ needs.run_on_windows_x64.outputs.version }}
path: ./release_assets
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ needs.run_on_windows_x64.outputs.version }}
release_name: Release v${{ needs.run_on_windows_x64.outputs.version }}
draft: false
prerelease: false
- name: Upload x64 exe to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release_assets/barebones_shell_x64_v${{ needs.run_on_windows_x64.outputs.version }}.exe
asset_name: barebones_shell_x64_v${{ needs.run_on_windows_x64.outputs.version }}.exe
asset_content_type: application/octet-stream