-
Notifications
You must be signed in to change notification settings - Fork 4
132 lines (128 loc) · 4.61 KB
/
package.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
name: Packaging
on:
push:
tags:
- "v*"
jobs:
make-outputs:
runs-on: ubuntu-latest
outputs:
VERSION: ${{ steps.get_version.outputs.VERSION }}
steps:
- name: Get version
id: get_version
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_OUTPUT
release:
runs-on: ${{ matrix.os }}
needs: [make-outputs]
strategy:
matrix:
include:
- os: windows-latest
pkg_suffix: win-amd64.zip
- os: ubuntu-latest
pkg_suffix: linux-x86_64.tar.gz
- os: macos-14
pkg_suffix: macos-universal2.dmg
steps:
- uses: actions/checkout@v4
- name: Set up Python (Windows & Linux)
if: matrix.os != 'macos-14'
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Set up Python (MacOS Universal2)
if: matrix.os == 'macos-14'
run: |
curl -L https://www.python.org/ftp/python/3.11.7/python-3.11.7-macos11.pkg --output ~/Downloads/python.pkg
sudo installer -pkg ~/Downloads/python.pkg -target /
- name: Install OS dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libegl1
- uses: pdm-project/setup-pdm@v4
with:
python-version: 3.11
- name: Install dependencies (Windows & Linux)
if: matrix.os != 'macos-14'
run: pdm sync -G desktop -G ujson -G packaging --no-editable
- name: Install dependencies (MacOS Universal2)
if: matrix.os == 'macos-14'
run: |
pdm export -G desktop -G ujson -G packaging -o packaging/requirements.txt --without-hashes
python -m venv .venv
source .venv/bin/activate
cd packaging
python -m ensurepip --upgrade
python -m pip install delocate
python universal2_install.py
cd ..
pdm build --no-sdist
python -m pip install dist/*.whl --no-deps
- name: Build with cx_freeze (Windows & Linux)
if: matrix.os != 'macos-14'
shell: bash -el {0}
run: |
cd packaging
pdm run python setup.py bdist_portable
cd ..
- name: Build with cx_freeze (MacOS Universal2)
if: matrix.os == 'macos-14'
run: |
source .venv/bin/activate
cd packaging
python setup.py bdist_dmg
mkdir dist
mv build/LibreSVIP.dmg dist/LibreSVIP-${{ needs.make-outputs.outputs.VERSION }}.${{ matrix.pkg_suffix }}
cd ..
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: libresvip-${{ matrix.pkg_suffix }}
path: ./packaging/dist
- name: Create Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
tag_name: v${{ needs.make-outputs.outputs.VERSION }}
files: |
./packaging/dist/LibreSVIP-${{ needs.make-outputs.outputs.VERSION }}.${{ matrix.pkg_suffix }}
release_linux_aarch64:
runs-on: ubuntu-latest
needs: [make-outputs]
steps:
- uses: actions/checkout@v4
- uses: uraimo/run-on-arch-action@v2
name: Build artifact
with:
arch: aarch64
distro: ubuntu20.04
dockerRunArgs: --volume "${PWD}:/libresvip"
install: |
apt-get update
apt-get install -y software-properties-common
add-apt-repository ppa:deadsnakes/ppa
apt-get update
apt-get install -y libdouble-conversion3 libfreetype6 libfontconfig1 libegl1 libgl1 libmediainfo-dev libtiff5 libwayland-dev libwebp6 libwebpdemux2 libwebpmux3 libxt6 python3.11-dev python3.11-venv
update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1
run: |
cd /libresvip
python -m ensurepip --upgrade
python -m pip install pdm
python -m pdm sync -G desktop -G ujson -G packaging --no-editable
cd packaging
python -m pdm run python setup.py bdist_portable
cd ..
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: libresvip-linux-aarch64.tar.gz
path: ./packaging/dist
- name: Create Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
tag_name: v${{ needs.make-outputs.outputs.VERSION }}
files: |
./packaging/dist/LibreSVIP-${{ needs.make-outputs.outputs.VERSION }}.linux-aarch64.tar.gz