-
Notifications
You must be signed in to change notification settings - Fork 3
104 lines (88 loc) · 3.68 KB
/
static_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
name: static_build
# this workflow is designed to:
# 1. create a static redistributable "build" of nice123d
# 2. create an OS specific launcher executable as an obvious entry point
on: [workflow_dispatch]
env:
UV_INSTALL_DIR: uv
jobs:
builds:
strategy:
fail-fast: false
matrix:
python-version: ["3.12"]
# os: [windows-latest]
os: [macos-14, ubuntu-latest, windows-latest]
# os: [macos-13, macos-14, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Check out nice123d from github repo
uses: actions/checkout@v4
- name: (linux) Download correct python-build-standalone
if: runner.os == 'Linux'
shell: bash -l {0}
run: |
curl -L -O https://github.com/astral-sh/python-build-standalone/releases/download/20250212/cpython-3.12.9+20250212-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz
mkdir python_local
tar -xzf cpython-3.12.9+20250212-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz -C python_local
./python_local/python/python -m pip install uv
./python_local/python/python -m uv pip install .
- name: (mac14) Download correct python-build-standalone
if: matrix.os == 'macos-14'
shell: bash -l {0}
run: |
curl -L -O https://github.com/astral-sh/python-build-standalone/releases/download/20250212/cpython-3.12.9+20250212-aarch64-apple-darwin-install_only_stripped.tar.gz
mkdir python_local
tar -xzf cpython-3.12.9+20250212-aarch64-apple-darwin-install_only_stripped.tar.gz -C python_local
./python_local/python/python -m pip install uv
./python_local/python/python -m uv pip install .
- name: (win) Download correct python-build-standalone
if: runner.os == 'Windows'
shell: bash -l {0}
run: |
curl -L -O https://github.com/astral-sh/python-build-standalone/releases/download/20250212/cpython-3.12.9+20250212-x86_64-pc-windows-msvc-install_only_stripped.tar.gz
mkdir python_local
tar -xzf cpython-3.12.9+20250212-x86_64-pc-windows-msvc-install_only_stripped.tar.gz -C python_local
python_local/python/python.exe -m pip install uv
python_local/python/python.exe -m uv pip install .
- name: (linux) Build launcher with go
if: runner.os == 'Linux'
shell: bash -l {0}
run: |
go version
cd tools/nice123d_run
go build -o nice123d_run main.go
chmod +x nice123d_run
cp nice123d_run ../../python_local/
- name: (mac14) Build launcher with go
if: matrix.os == 'macos-14'
shell: bash -l {0}
run: |
go version
cd tools/nice123d_run
go build -o nice123d_run main.go
chmod +x nice123d_run
cp nice123d_run ../../python_local/
- name: (win) Build launcher with go
if: runner.os == 'Windows'
shell: bash -l {0}
run: |
go version
cd tools/nice123d_run
go build -o nice123d_run.exe main.go
cp nice123d_run.exe ../../python_local/
- name: (all) Upload build artifact
uses: actions/upload-artifact@v4
with:
name: nice123d-${{ matrix.os }}
path: ./python_local
# ls -lRa
# - name: Install the latest version of uv
# uses: astral-sh/setup-uv@v5
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install nice123d from local folder
# run: uv pip install .
# - name: Enumerate venv dir
# shell: bash --login {0}
# run: ls -lRa