-
Notifications
You must be signed in to change notification settings - Fork 4
144 lines (121 loc) · 4.61 KB
/
Copy pathbriefcase_build.yml
File metadata and controls
144 lines (121 loc) · 4.61 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
name: Briefcase Build
on:
push:
branches:
- main
- develop
tags:
- 'v[0-9].*'
jobs:
briefcase:
name: Bundle on ${{ matrix.os }} / ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
python-version: ["3.11"]
arch: ["x86_64"]
fail-fast: false
defaults:
run:
shell: bash
steps:
- name: Get Ubuntu version
id: get-ubuntu-version
run: echo "UBUNTU_VERSION="$(lsb_release -rs) >> "$GITHUB_OUTPUT"
- name: Checkout code
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install Linux packages
if: runner.os == 'Linux'
run: |
sudo apt update && sudo apt install -y tzdata gnupg ca-certificates
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3B4FE6ACC0B21F32
echo "deb http://cz.archive.ubuntu.com/ubuntu bionic main" | sudo tee -a /etc/apt/sources.list.d/bionic.list
sudo apt-get update
sudo apt-get install libncurses5 libgdbm5 libffi6 libegl1 libpulse0 libpcsclite1
- name: Install Qt on Ubuntu 20.04
if: ${{ steps.get-ubuntu-version.outputs.UBUNTU_VERSION == '20.04' }}
uses: jurplel/install-qt-action@v3
with:
version: '6.4.2'
setup-python: false
- name: Install Qt on Ubuntu 22.04
if: ${{ steps.get-ubuntu-version.outputs.UBUNTU_VERSION == '22.04' }}
uses: jurplel/install-qt-action@v3
with:
version: '6.6.1'
setup-python: false
- name: Modify Qt version in pyproject.toml for Ubuntu 20.04
if: ${{ steps.get-ubuntu-version.outputs.UBUNTU_VERSION == '20.04' }}
run: |
sed -i '/--- ubuntu-22.04 ---/,/--- ubuntu-22.04 end ---/d' pyproject.toml
- name: Modify Qt version in pyproject.toml for Ubuntu 22.04
if: ${{ steps.get-ubuntu-version.outputs.UBUNTU_VERSION == '22.04' }}
run: |
sed -i '/--- ubuntu-20.04 ---/,/--- ubuntu-20.04 end ---/d' pyproject.toml
- name: Install Python pip
run: python -m pip install --upgrade pip
- name: Install Python libs
run: |
python -m pip install briefcase==0.3.11
python -m pip install MarkupSafe==2.1.1
- name: Install maturin
run: |
pip install maturin==1.2.3
- name: build and install tantivy-py wheel
run: |
git clone https://github.com/simsapa/tantivy-py.git
ls -l
cd tantivy-py
git checkout simsapa
make build
python -m pip install $(ls -1 target/wheels/*.whl)
# Wheel name on Ubuntu 22.04:
# "./tantivy-py/target/wheels/tantivy-0.20.2rc1-cp311-cp311-manylinux_2_34_x86_64.whl",
# Wheel name on Ubuntu 20.04:
# "./tantivy-py/target/wheels/tantivy-0.20.2rc1-cp311-cp311-manylinux_2_31_x86_64.whl"
- name: correct wheel file name in pyproject.toml
if: ${{ steps.get-ubuntu-version.outputs.UBUNTU_VERSION == '20.04' }}
run: |
sed -i 's/\(tantivy-.*-manylinux\)_2_34_x86_64.whl/\1_2_31_x86_64.whl/' pyproject.toml
- name: Linux Create and Build Without Docker
if: runner.os == 'Linux'
run: |
briefcase create linux appimage --no-docker
briefcase build linux appimage --no-docker
- name: Windows / Mac Create and Build Bundle
if: runner.os != 'Linux'
run: |
briefcase create linux appimage
briefcase build linux appimage
- name: Package Mac
if: runner.os == 'macOS'
run: briefcase package --no-sign
- name: Package Windows
if: runner.os == 'Windows'
run: briefcase package
- name: Package Linux
if: runner.os == 'Linux'
run: briefcase package linux appimage --no-docker
- name: Upload Artifact for Linux
uses: actions/upload-artifact@v4
if: runner.os == 'Linux'
with:
name: simsapa-${{ github.ref_name }}-${{ matrix.os }}.AppImage
path: '**/*.AppImage'
- name: Upload Artifact for MacOS
uses: actions/upload-artifact@v4
if: runner.os == 'MacOS'
with:
name: simsapa-${{ github.ref_name }}-${{ matrix.os }}-${{ matrix.arch }}.dmg
path: '**/*.dmg'
- name: Upload Artifact for Windows
uses: actions/upload-artifact@v4
if: runner.os == 'Windows'
with:
name: simsapa-${{ github.ref_name }}-${{ matrix.os }}.msi
path: '**/*.msi'