-
Notifications
You must be signed in to change notification settings - Fork 35
95 lines (82 loc) · 2.94 KB
/
main.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
name: Build PROS CLI
on:
push:
pull_request:
jobs:
update_build_number:
runs-on: ubuntu-latest
outputs:
output1: ${{ steps.step1.outputs.test }}
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- name: Update Build Number
id: step1
run: |
git describe --tags
git clean -f
python3 version.py
echo "::set-output name=test::$(cat version)"
build:
needs: update_build_number
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- name: Setup Python
uses: actions/[email protected]
with:
python-version: 3.9
cache: 'pip'
if: matrix.os != 'macos-latest'
- name: Setup Python MacOS
run: |
wget https://www.python.org/ftp/python/3.10.11/python-3.10.11-macos11.pkg
sudo installer -verbose -pkg ./python-3.10.11-macos11.pkg -target /
echo "/Library/Frameworks/Python.framework/Versions/3.10/bin" >> $GITHUB_PATH
if: matrix.os == 'macos-latest'
- name: Install Requirements
run: python3 -m pip install --upgrade pip && pip3 install wheel && pip3 install -r requirements.txt && pip3 uninstall -y typing
- name: Build Wheel
run: python3 setup.py bdist_wheel
if: matrix.os == 'ubuntu-latest'
- name: Upload Wheel
uses: actions/[email protected]
with:
name: pros-cli-wheel-${{needs.update_build_number.outputs.output1}}
path: dist/*
if: matrix.os == 'ubuntu-latest'
- name: Run Pyinstaller
run: |
python3 version.py
pyinstaller pros.spec
pyinstaller --onefile pros/cli/compile_commands/intercept-cc.py --name=intercept-cc
pyinstaller --onefile pros/cli/compile_commands/intercept-cc.py --name=intercept-c++
if: matrix.os != 'macos-latest'
- name: Run Pyinstaller MacOS
run: |
pip3 uninstall -y charset_normalizer
git clone https://github.com/Ousret/charset_normalizer.git
pip3 install -e ./charset_normalizer
python3 version.py
pyinstaller pros-macos.spec
pyinstaller --onefile pros/cli/compile_commands/intercept-cc.py --name=intercept-cc --target-arch=universal2
pyinstaller --onefile pros/cli/compile_commands/intercept-cc.py --name=intercept-c++ --target-arch=universal2
if: matrix.os == 'macos-latest'
- name: Package Everything Up
shell: bash
run: |
cd dist/
mv intercept-cc pros
mv intercept-c++ pros
- name: Upload Artifact
uses: actions/[email protected]
with:
name: ${{ matrix.os }}-${{needs.update_build_number.outputs.output1}}
path: dist/pros/*