-
Notifications
You must be signed in to change notification settings - Fork 212
182 lines (158 loc) · 6.49 KB
/
workflow-build-matrix.yml
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# Project : Screenipy
# Author : Pranjal Joshi
# Created : 30/04/2021
# Description : Workflow for building screenipy on pushing a tag
name: Screenipy Build - New Release
on:
push:
#branches: [ pre-main ]
tags:
- '*'
jobs:
# Job for builing packages
Build-Executables:
name: Build Packages
runs-on: ubuntu-latest
needs: Docker-Build
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# include:
# - os: windows-latest
# TARGET: Windows
# CMD_BUILD: |
# pyinstaller --onefile --icon=src\icon.ico src\screenipy.py --hidden-import cmath --hidden-import talib.stream --hidden-import numpy --hidden-import pandas --hidden-import alive-progress --hidden-import alive_progress --hidden-import chromadb
# DEP_BUILD: |
# python -m pip install --upgrade pip
# echo Installing TA-lib...
# cd .github/dependencies/
# echo %cd%
# pip install TA_Lib-0.4.19-cp39-cp39-win_amd64.whl
# cd ..
# cd ..
# python -m pip install --upgrade pip
# pip install -r requirements.txt
# TEST_BUILD: |
# ./dist/screenipy.exe --testbuild
# exit $?
# OUT_PATH: .\dist\screenipy.exe
# FILE_NAME: screenipy.exe
# - os: ubuntu-20.04
# TARGET: Linux
# CMD_BUILD: |
# pyinstaller --onefile --icon=src/icon.ico src/screenipy.py --hidden-import cmath --hidden-import talib.stream --hidden-import numpy --hidden-import pandas --hidden-import alive-progress --hidden-import alive_progress --hidden-import chromadb
# mv /home/runner/work/Screeni-py/Screeni-py/dist/screenipy /home/runner/work/Screeni-py/Screeni-py/dist/screenipy.bin
# chmod +x /home/runner/work/Screeni-py/Screeni-py/dist/screenipy.bin
# DEP_BUILD: |
# cd .github/dependencies/
# pwd
# tar -xzf ta-lib-0.4.0-src.tar.gz
# cd ta-lib/
# ./configure --prefix=/usr
# make
# sudo make install
# cd /home/runner/work/Screeni-py/Screeni-py/
# python -m pip install --upgrade pip
# pip install -r requirements.txt
# pip install ta-lib==0.4.24
# TEST_BUILD: |
# /home/runner/work/Screeni-py/Screeni-py/dist/screenipy.bin --testbuild
# exit $?
# OUT_PATH: /home/runner/work/Screeni-py/Screeni-py/dist/screenipy.bin
# FILE_NAME: screenipy.bin
# - os: macos-latest
# TARGET: MacOS
# CMD_BUILD: |
# pyinstaller --onefile --windowed --icon=src/icon.ico src/screenipy.py --hidden-import cmath --hidden-import talib.stream --hidden-import numpy --hidden-import pandas --hidden-import alive-progress --hidden-import alive_progress --hidden-import chromadb
# mv /Users/runner/work/Screeni-py/Screeni-py/dist/screenipy /Users/runner/work/Screeni-py/Screeni-py/dist/screenipy.run
# DEP_BUILD: |
# brew install ta-lib
# python -m pip install --upgrade pip
# pip install -r requirements.txt
# pip install ta-lib==0.4.24
# TEST_BUILD: |
# /Users/runner/work/Screeni-py/Screeni-py/dist/screenipy.run --testbuild
# exit $?
# OUT_PATH: /Users/runner/work/Screeni-py/Screeni-py/dist/screenipy.run
# FILE_NAME: screenipy.run
steps:
- uses: actions/checkout@v4
- name: Get the GitHub Tag version
id: get_version
shell: bash
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
# - name: Set up Python 3.9.4
# uses: actions/setup-python@v2
# with:
# python-version: 3.9.4
# - name: Load Cache for Linux Dependencies
# uses: actions/cache@v2
# if: startsWith(runner.os, 'Linux')
# with:
# path: |
# /usr/include/ta-lib
# /usr/bin/ta-lib-config
# key: ${{ runner.os }}-talib
# restore-keys: |
# ${{ runner.os }}-talib
# - name: Install dependencies for ${{ matrix.TARGET }}
# run: ${{ matrix.DEP_BUILD }}
# - name: Build for ${{ matrix.TARGET }}
# run: ${{ matrix.CMD_BUILD }}
# - name: Test Built Binary for ${{ matrix.TARGET }}
# shell: bash
# run: ${{ matrix.TEST_BUILD }}
# continue-on-error: false
# - name: Save Binaries as Artifacts
# uses: actions/upload-artifact@v2
# with:
# name: ${{ matrix.FILE_NAME }}
# path: ${{ matrix.OUT_PATH }}
- name: Read release.md
id: read_release
shell: bash
run: |
r=$(cat src/release.md)
r="${r//'%'/'%25'}"
r="${r//$'\n'/'%0A'}"
r="${r//$'\r'/'%0D'}"
echo "::set-output name=RELEASE_BODY::$r"
- name: Upload Binaries to Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: README.md
asset_name: README.md
tag: ${{ github.ref }}
release_name: Screenipy - v${{ steps.get_version.outputs.VERSION }}
body: |
${{ steps.read_release.outputs.RELEASE_BODY }}
overwrite: true
Docker-Build:
name: Build and Release Docker Multi-Arch images
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Setup hardware emulator using QEMU
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# Setup Docker Buildx for multi-arch images
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Get tag version version
id: version
run: |
VER=$(grep 'VERSION = ' src/classes/Changelog.py | awk -F'"' '{print $2}')
echo "VERSION=$VER" >> $GITHUB_ENV
- name: Streamlit Build and Push
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64, linux/arm64
push: true
tags: joshipranjal/screeni-py:latest, joshipranjal/screeni-py:${{ env.VERSION }}