forked from indygreg/PyOxidizer
-
Notifications
You must be signed in to change notification settings - Fork 0
207 lines (181 loc) · 5.65 KB
/
pyoxy.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
on:
push:
branches-ignore:
- 'ci-test'
tags-ignore:
- '**'
pull_request:
schedule:
- cron: '13 15 * * *'
workflow_dispatch:
jobs:
pyoxidizer-linux:
runs-on: 'ubuntu-22.04'
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/rust-bootstrap
with:
rust_toolchain: stable
rust_target: x86_64-unknown-linux-musl
- name: Build pyoxidizer Executable
run: |
cargo build --bin pyoxidizer --target x86_64-unknown-linux-musl
# The binary is a bit large so strip it.
strip target/x86_64-unknown-linux-musl/debug/pyoxidizer
- name: Upload
uses: actions/upload-artifact@v3
with:
name: pyoxidizer-exe-linux
path: target/x86_64-unknown-linux-musl/debug/pyoxidizer
pyoxidizer-macos:
runs-on: 'macos-12'
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/rust-bootstrap
with:
rust_toolchain: stable
rust_target: x86_64-apple-darwin
- name: Build pyoxidizer Executable
run: |
cargo build --bin pyoxidizer
# The binary is a bit large so strip it.
strip target/debug/pyoxidizer
- name: Upload
uses: actions/upload-artifact@v3
with:
name: pyoxidizer-exe-macos
path: target/debug/pyoxidizer
build-linux:
needs:
- pyoxidizer-linux
strategy:
fail-fast: false
matrix:
python_version:
- '3.8'
- '3.9'
- '3.10'
target_triple:
- 'x86_64-unknown-linux-gnu'
# Not yet working due to rust config issues.
# - 'x86_64-unknown-linux-musl'
runs-on: 'ubuntu-22.04'
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/rust-bootstrap
with:
rust_toolchain: stable
rust_target: ${{ matrix.target_triple }}
- name: Download PyOxidizer Executable
uses: actions/download-artifact@v3
with:
name: pyoxidizer-exe-linux
path: /usr/local/bin/
- name: Restore Docker Image Cache
id: cache-image
uses: actions/cache@v2
with:
path: ~/image.tar
key: ${{ runner.os }}-${{ hashFiles('ci/linux-portable-binary.Dockerfile') }}
- name: Build Docker Image
if: steps.cache-image.outputs.cache-hit != 'true'
run: |
cd ci
docker build -f linux-portable-binary.Dockerfile -t pyoxidizer:build .
docker save -o ~/image.tar pyoxidizer:build
- name: Load Docker Image
if: steps.cache-image.outputs.cache-hit == 'true'
run: |
docker load -i ~/image.tar
- name: Build pyoxy Linux Executable
run: |
chmod +x /usr/local/bin/pyoxidizer
just actions-build-pyoxy-linux ${{ matrix.target_triple }} ${{ matrix.python_version }}
- name: Upload
uses: actions/upload-artifact@v3
with:
name: exe-pyoxy-${{ matrix.target_triple }}-${{ matrix.python_version }}
path: upload/*
# This is nearly identical to build-exe.yml and could likely be consolidated
# with some additional parameters to that workflow.
build-macos:
needs:
- pyoxidizer-macos
strategy:
fail-fast: false
matrix:
python_version:
- '3.8'
- '3.9'
- '3.10'
target_triple:
- 'aarch64-apple-darwin'
- 'x86_64-apple-darwin'
runs-on: 'macos-12'
env:
IN_CI: '1'
AWS_REGION: us-west-2
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SCCACHE_BUCKET: 'pyoxidizer-sccache'
SCCACHE_S3_USE_SSL: '1'
# Prevent sccache server from stopping due to inactivity.
SCCACHE_IDLE_TIMEOUT: '0'
CARGO_INCREMENTAL: '0'
RUSTC_WRAPPER: sccache
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ./.github/actions/rust-bootstrap
with:
rust_toolchain: stable
rust_target: ${{ matrix.target_triple }}
- name: Download PyOxidizer Executable
uses: actions/download-artifact@v3
with:
name: pyoxidizer-exe-macos
path: /usr/local/bin/
- name: Build
run: |
chmod +x /usr/local/bin/pyoxidizer
just actions-build-pyoxy-macos ${{ matrix.target_triple }} ${{ matrix.python_version }}
- name: Upload
uses: actions/upload-artifact@v3
with:
name: exe-pyoxy-${{ matrix.target_triple }}-${{ matrix.python_version }}
path: upload/*
macos-universal:
needs:
- build-macos
strategy:
fail-fast: false
matrix:
python_version:
- '3.8'
- '3.9'
- '3.10'
runs-on: 'macos-12'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ./.github/actions/install-just
- name: Download aarch64 executable
uses: actions/download-artifact@v3
with:
name: exe-pyoxy-aarch64-apple-darwin-${{ matrix.python_version }}
path: pyoxy-aarch64
- name: Download x86-64 executable
uses: actions/download-artifact@v3
with:
name: exe-pyoxy-x86_64-apple-darwin-${{ matrix.python_version }}
path: pyoxy-x86-64
- name: Produce Universal Binary
run: |
just actions-macos-universal pyoxy
- name: Upload Universal Executable
uses: actions/upload-artifact@v3
with:
name: exe-pyoxy-macos-universal-${{ matrix.python_version }}
path: uploads/*