Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
name: build

on:
push:
tags:
- "v*"
# pull_request:
# branches:
# - main
pull_request:
branches:
- main

jobs:
build-and-test:
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,42 @@ jobs:
name: cibw-sdist
path: dist/*.tar.gz

build_installer:
name: Build Windows Installer
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'

- name: Install dependencies
run: |
pip install pyinstaller
pip install .[MT5]

- name: Build executable
run: pyinstaller tcopier.spec

- name: Replace version in Inno Setup script
run: |
$version = "${{ github.ref_name }}".Substring(1)
(Get-Content tcopier.iss) -replace '__VERSION__', $version | Set-Content tcopier.iss

- name: Install Inno Setup
uses: Minionguyj/inno-setup-action@v2.2.2

- name: Compile installer
run: iscc tcopier.iss

- name: Upload installer artifact
uses: actions/upload-artifact@v4
with:
name: installer
path: "**/TradeCopier.exe"


publish:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
Expand All @@ -84,3 +120,21 @@ jobs:
with:
user: __token__
password: ${{ secrets.BBSTRADER_PYPI_API_TOKEN }}

release:
name: Create GitHub Release
needs: [build_installer, publish]
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')

steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: dist/*
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ notes.txt
*.h5
*ipynb_checkpoints/
*.exe
*.iss
cmd.ps1
.vscode
CMakePresets.json
Expand Down
25 changes: 25 additions & 0 deletions tcopier.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[Setup]
AppName=TradeCopier
AppVersion=2.0.2
AppPublisher=bbstrading
DefaultDirName={pf}\TradeCopier
DefaultGroupName=TradeCopier
OutputDir=.
OutputBaseFilename=TradeCopier
Compression=lzma
SolidCompression=yes
LicenseFile=LICENSE
SetupIconFile=bbstrader\assets\bbstrader.ico

[Files]
Source: "dist\tcopier.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "bbstrader\assets\bbstrader.ico"; DestDir: "{app}"; Flags: ignoreversion
[Icons]
Name: "{group}\TradeCopier"; Filename: "{app}\tcopier.exe"; IconFilename: "{app}\bbstrader.ico"
Name: "{group}\Uninstall tradecopier"; Filename: "{uninstallexe}"
Name: "{commondesktop}\tradecopier"; Filename: "{app}\tcopier.exe"; IconFilename: "{app}\bbstrader.ico"; Tasks: desktopicon



[Tasks]
Name: "desktopicon"; Description: "Create a &desktop shortcut"; GroupDescription: "Additional icons:"
Loading