-
Notifications
You must be signed in to change notification settings - Fork 33
90 lines (77 loc) · 2.71 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
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/checkout@v3.1.0
with:
fetch-depth: 0
- name: Update Build Number
id: step1
run: |
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/checkout@v3.1.0
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v4.3.0
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.9.2/python-3.9.2-macos11.pkg
sudo installer -verbose -pkg ./python-3.9.2-macos11.pkg -target /
echo "/Library/Frameworks/Python.framework/Versions/3.9/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/upload-artifact@v3.1.0
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: |
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/upload-artifact@v3.1.0
with:
name: ${{ matrix.os }}-${{needs.update_build_number.outputs.output1}}
path: dist/*