forked from RamanujanMachine/LIReC
-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (123 loc) · 4.34 KB
/
build_and_deploy.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
name: 'Build and Deploy to BOINC Server'
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
define-version:
uses: ./.github/workflows/identify_target_version.yml
with:
# we use the description to fetch the latest version of the app from the BOINC server apps page
boinc_app_description: ${{ vars.APP_DESCRIPTION }}
generate-freeze-config:
runs-on: ubuntu-latest
steps:
- name: "Checkout repository"
# https://github.com/actions/checkout
uses: actions/checkout@v4
- name: "Create cxFreeze config file"
env:
EXECUTABLE: ${{ vars.EXECUTABLE }}
APP_DESCRIPTION: ${{ vars.APP_DESCRIPTION }}
run: |
sed -e "s/{EXECUTABLE}/$EXECUTABLE/g" -e "s/{APP_DESCRIPTION}/$APP_DESCRIPTION/g" boinc/freeze_config_template.py > freeze_config.py
- name: "Upload cxFreeze config artifact"
uses: actions/upload-artifact@v4
with:
name: freeze_config.py
path: freeze_config.py
overwrite: true
build-binaries:
needs: [generate-freeze-config]
runs-on: ${{ matrix.runner }}
strategy:
matrix:
runner:
# - ubuntu-latest
# - macos-latest
- windows-latest
include:
# - runner: ubuntu-latest
# # we use this platform string to make our download artifacts unique for the same version across platforms
# platform: 'linux'
- runner: windows-latest
# we use this platform string to make our download artifacts unique for the same version across platforms
platform: 'win'
# - runner: macos-latest
# # we use this platform string to make our download artifacts unique for the same version across platforms
# platform: 'mac'
steps:
- name: "Checkout repository"
# https://github.com/actions/checkout
uses: actions/checkout@v4
- name: "Configure python"
# https://github.com/actions/setup-python
uses: actions/setup-python@v5
with:
python-version: "3.11.7"
- name: "Install system dependencies on macOS"
if: runner.os == 'macOS'
run: |
brew install postgresql
brew link postgresql
- name: "Install dependencies and cxFreeze"
run: |
#apt-get -y install libpq-dev libgmp-dev libgmp3-dev libmpfr-dev libmpc-dev
pip install -e .
pip install --upgrade cx_Freeze
- name: "Download previously created freeze configuration"
uses: actions/download-artifact@v4
with:
name: freeze_config.py
- name: "Build binary"
run: | # See https://cx-freeze.readthedocs.io/en/stable/script.html#script
cat freeze_config.py
python freeze_config.py build
- name: "Upload cxFreeze binaries"
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform }}
path: build/executable
overwrite: true
bundle-and-deploy:
needs: [define-version, build-binaries]
uses: ./.github/workflows/bundle_app.yml
secrets: inherit
with:
new_version: ${{ needs.define-version.outputs.new_version }}
platform: ${{ matrix.platform }}
wrapper: ${{ matrix.wrapper }}
boinc_platform: ${{ matrix.boinc_platform }}
executable: ${{ vars.EXECUTABLE }}
app_dir: ${{ vars.APP_DIR }}
strategy:
matrix:
platform:
# - linux
# - mac
- win
include:
# - platform: 'linux'
# # These wrappers come from BOINC and should be watched for newer versions: https://boinc.berkeley.edu/dl/?C=M;O=D
# wrapper: 'wrapper_26002_x86_64-pc-linux-gnu'
# boinc_platform: 'x86_64-pc-linux-gnu'
- platform: 'win'
wrapper: 'wrapper_26016_windows_x86_64'
boinc_platform: 'windows_x86_64'
# - platform: 'mac'
# wrapper: 'wrapper_26017_universal-apple-darwin'
# boinc_platform: 'arm64-apple-darwin'
cleanup:
needs: [bundle-and-deploy]
runs-on: ubuntu-latest
steps:
- uses: geekyeggo/delete-artifact@v5
with:
name: |
version
freeze_config.py
# linux
# mac
win
failOnError: false