-
Notifications
You must be signed in to change notification settings - Fork 8
130 lines (109 loc) · 3.69 KB
/
build.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
name: build
on: [push]
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: prep
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install pyinstaller==6.3.0
rm -rf build dist
- name: build
shell: bash
run: |
echo "RUNNER_OS: $RUNNER_OS"
pyinstaller rsyncy.py --onefile --name rsyncy --console
cat build/rsyncy/warn-rsyncy.txt
cd dist; ls -l
if [ "$RUNNER_OS" == "Linux" ]; then
tar -czf rsyncy-linux_amd64.tar.gz rsyncy
elif [ "$RUNNER_OS" == "macOS" ]; then
tar -czf rsyncy-macos_amd64.tar.gz rsyncy
else
echo 'unknown runner'
exit 1
fi
- name: artifact
uses: actions/upload-artifact@v4
if: runner.os == 'Linux'
with:
name: binary-${{ matrix.os }}
path: dist/rsyncy*.tar.gz
- name: artifact
uses: actions/upload-artifact@v4
if: runner.os == 'macOS'
with:
name: binary-${{ matrix.os }}
path: dist/rsyncy*.tar.gz
build_arm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pguyot/arm-runner-action@v2
with:
base_image: raspios_lite_arm64:latest
image_additional_mb: 2048
bind_mount_repository: true
commands: |
# install python 3.12
# apt update && apt upgrade -y && apt -qq install -y build-essential zlib1g-dev uuid-dev liblzma-dev lzma-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev libbz2-dev
# mkdir -p /pybuild
# cd /pybuild
# wget https://www.python.org/ftp/python/3.12.0/Python-3.12.0.tgz
# tar -xf Python-3.12.0.tgz
# cd Python-3.12.0
# ./configure --enable-optimizations --enable-shared < /dev/null
# make -j $(nproc) < /dev/null
# make altinstall -j $(nproc) < /dev/null
# rm -rf /usr/bin/python
# ls -l /usr/local/bin/
# ln -s /usr/local/bin/python3.12 /usr/bin/python
# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/python3.12
# export PYTHONPATH=/usr/local/lib/python3.12
# python -m pip install --upgrade pip
# python -m pip install pyinstaller==6.3.0
# pip for python 3.11
apt update && apt -qq install -y python3 python3-pip
python -m pip install pyinstaller==6.3.0 --break-system-packages
python -V
cd /rsyncy
rm -rf build dist
pyinstaller rsyncy.py --onefile --name rsyncy --console
cat build/rsyncy/warn-rsyncy.txt
find
cd dist; pwd; ls -l
tar -czf rsyncy-linux_arm64.tar.gz rsyncy
- name: artifact
uses: actions/upload-artifact@v4
with:
name: binary-linux-arm
path: dist/rsyncy*.tar.gz
publish:
runs-on: ubuntu-latest
needs: [build, build_arm]
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
steps:
- name: get-artifacts
uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: list
shell: bash
run: |
find
ls -l dist
- name: publish-release
uses: softprops/action-gh-release@v1
with:
draft: true
files: dist/*