forked from mattsta/signal-backup
-
-
Notifications
You must be signed in to change notification settings - Fork 55
99 lines (86 loc) · 2.7 KB
/
release.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
name: release
on:
push:
tags:
- '*'
workflow_dispatch:
jobs:
build:
name: build ${{ matrix.os }} ${{ matrix.py }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest", "macos-latest"]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: prep pysqlcipher3
run: |
git clone --depth=1 --branch=master https://github.com/rigglemania/pysqlcipher3.git
cd pysqlcipher3
mkdir amalgamation
cp ../sqlcipher/sqlite3.[ch] amalgamation
mkdir src/python3/sqlcipher
cp ../sqlcipher/sqlite3.[ch] src/python3/sqlcipher
pip install setuptools
- name: build pysqlcipher3 linux
if: matrix.os == 'ubuntu-latest'
run: |
cd pysqlcipher3
python setup.py build_amalgamation
python setup.py build
- name: build pysqlcipher3 macOS
if: matrix.os == 'macos-latest'
run: |
brew install openssl
export LDFLAGS="-L/opt/homebrew/opt/openssl@3/lib"
export CPPFLAGS="-I/opt/homebrew/opt/openssl@3/include"
cd pysqlcipher3
python setup.py build_amalgamation
python setup.py build
- name: post-build pysqlcipher3
run: |
mkdir src/pysqlcipher3
for f in pysqlcipher3/build/lib.*/pysqlcipher3/*.{py,so}; do cp $f src/pysqlcipher3/; done
- name: build
run: |
pip install build
python -m build
PLATFORM_TAG=$(python -c 'import sysconfig; print(sysconfig.get_platform().replace("-", "_").replace(".", "_"))')
cd dist
NEW_NAME=$(ls *.whl | sed "s/any.whl$/${PLATFORM_TAG}.whl/")
mv *.whl $NEW_NAME
echo "WHEEL_NAME=$(ls *.whl)" >> $GITHUB_ENV
echo "SDIST_NAME=$(ls *.tar.gz)" >> $GITHUB_ENV
- name: test
run: |
pip install dist/*.whl pytest
pytest
- uses: actions/upload-artifact@v4
with:
name: ${{ env.WHEEL_NAME }}
path: "dist/*.whl"
- uses: actions/upload-artifact@v4
# only do this once
if: matrix.os == 'ubuntu-latest'
with:
name: ${{ env.SDIST_NAME }}
path: "dist/*.tar.gz"
upload:
needs: [build]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Copy artifacts to dist/ folder
run: |
mkdir -p dist/
mv *.tar.gz dist/
mv *.whl dist/
- name: Upload
uses: pypa/[email protected]
with:
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true