forked from PyProphet/pyprophet
-
Notifications
You must be signed in to change notification settings - Fork 0
217 lines (184 loc) · 6.1 KB
/
Copy pathbuild-release.yml
File metadata and controls
217 lines (184 loc) · 6.1 KB
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
208
209
210
211
212
213
214
215
216
217
name: Build and Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
build:
name: Build on ${{ matrix.os }} ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# Linux x86_64
- os: ubuntu-22.04
arch: x86_64
artifact_name: pyprophet-linux-x86_64
# Windows x86_64
- os: windows-latest
arch: x86_64
artifact_name: pyprophet-windows-x86_64
# macOS Intel (x86_64)
- os: macos-13 # Intel runner
arch: x86_64
artifact_name: pyprophet-macos-x86_64
# macOS Apple Silicon (ARM64)
- os: macos-latest # ARM64 runner (macos-14+)
arch: arm64
artifact_name: pyprophet-macos-arm64
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y build-essential
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
- name: Build executable (Linux)
if: runner.os == 'Linux'
run: bash scripts/build/build_linux.sh
- name: Build executable (Windows)
if: runner.os == 'Windows'
run: scripts/build/build_windows.bat
- name: Build executable (macOS)
if: runner.os == 'macOS'
run: bash scripts/build/build_macos.sh
# Create installers
- name: Create Linux packages (DEB/RPM)
if: runner.os == 'Linux'
run: bash scripts/build/create_linux_packages.sh
- name: Create Windows installer
if: runner.os == 'Windows'
run: pwsh scripts/build/create_windows_installer.ps1
- name: Create macOS DMG
if: runner.os == 'macOS'
run: bash scripts/build/create_macos_dmg.sh
# Verify artifacts
- name: Verify artifacts (Linux)
if: runner.os == 'Linux'
run: |
echo "Listing artifacts:"
ls -lh pyprophet-*.tar.gz *.deb *.rpm *.sha256 || echo "Some files missing"
- name: Verify artifacts (Windows)
if: runner.os == 'Windows'
run: |
echo "Listing artifacts:"
Get-ChildItem -Path . -Filter "pyprophet-*" | Format-Table Name, Length
shell: pwsh
- name: Verify artifacts (macOS)
if: runner.os == 'macOS'
run: |
echo "Listing artifacts:"
ls -lh pyprophet-*.tar.gz *.dmg *.sha256 || echo "Some files missing"
# Upload artifacts separately by type (Linux)
- name: Upload Linux tarball
if: runner.os == 'Linux'
uses: actions/upload-artifact@v4
with:
name: pyprophet-linux-x86_64-tarball
path: |
pyprophet-linux-*.tar.gz
pyprophet-linux-*.tar.gz.sha256
retention-days: 7
- name: Upload Linux DEB package
if: runner.os == 'Linux'
uses: actions/upload-artifact@v4
with:
name: pyprophet-linux-x86_64-deb
path: |
pyprophet_*.deb
pyprophet_*.deb.sha256
retention-days: 7
- name: Upload Linux RPM package
if: runner.os == 'Linux'
uses: actions/upload-artifact@v4
with:
name: pyprophet-linux-x86_64-rpm
path: |
pyprophet-*.rpm
pyprophet-*.rpm.sha256
retention-days: 7
# Upload artifacts separately by type (Windows)
- name: Upload Windows ZIP archive
if: runner.os == 'Windows'
uses: actions/upload-artifact@v4
with:
name: pyprophet-windows-x86_64-zip
path: |
pyprophet-windows-*.zip
pyprophet-windows-*.zip.sha256
retention-days: 7
- name: Upload Windows installer
if: runner.os == 'Windows'
uses: actions/upload-artifact@v4
with:
name: pyprophet-windows-x86_64-installer
path: |
pyprophet-setup-*.exe
pyprophet-setup-*.exe.sha256
retention-days: 7
# Upload artifacts separately by type (macOS)
- name: Upload macOS tarball
if: runner.os == 'macOS'
uses: actions/upload-artifact@v4
with:
name: pyprophet-macos-${{ matrix.arch }}-tarball
path: |
pyprophet-macos-*.tar.gz
pyprophet-macos-*.tar.gz.sha256
retention-days: 7
- name: Upload macOS DMG
if: runner.os == 'macOS'
uses: actions/upload-artifact@v4
with:
name: pyprophet-macos-${{ matrix.arch }}-dmg
path: |
pyprophet-*.dmg
pyprophet-*.dmg.sha256
retention-days: 7
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Display structure of downloaded files
run: |
echo "Artifact directory structure:"
find artifacts -type f -ls
- name: Prepare release assets
run: |
mkdir -p release-assets
find artifacts -type f \( -name "*.tar.gz" -o -name "*.zip" -o -name "*.deb" -o -name "*.rpm" -o -name "*.dmg" -o -name "*.exe" -o -name "*.sha256" \) -exec cp {} release-assets/ \;
echo "Release assets:"
ls -lh release-assets/
- name: Create Release
uses: softprops/action-gh-release@v1
with:
draft: false
prerelease: false
generate_release_notes: true
files: release-assets/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}