-
Notifications
You must be signed in to change notification settings - Fork 2
88 lines (74 loc) · 2 KB
/
Copy pathbuild.yml
File metadata and controls
88 lines (74 loc) · 2 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
name: Build and Release EXE
permissions:
contents: write
on:
push:
branches:
- master
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # ensure tags and full history for versioning
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install pyinstaller
- name: Build EXE
run: |
pyinstaller --clean --noconfirm SignalTrader.spec
- name: Upload EXE as Artifact
uses: actions/upload-artifact@v4
with:
name: app-exe
path: dist/*.exe
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch all tags for git describe
# Get last tag
- name: Get latest tag
id: get_tag
run: |
git fetch --tags || true
tag=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
echo "TAG=$tag" >> $GITHUB_OUTPUT
# Bump patch version
- name: Bump version
id: bump
run: |
old=${{ steps.get_tag.outputs.TAG }}
IFS='.' read -ra parts <<< "${old#v}"
major=${parts[0]}
minor=${parts[1]}
patch=${parts[2]}
new="v$major.$minor.$((patch+1))"
echo "NEW_TAG=$new" >> $GITHUB_OUTPUT
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: app-exe
path: ./dist
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.bump.outputs.NEW_TAG }}
name: Release ${{ steps.bump.outputs.NEW_TAG }}
files: |
./dist/*.exe
./config/keywords.json
./config/regex_patterns.json
./settings-template.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}