Skip to content

Commit 350f626

Browse files
committed
ci: Merge commit & version bump
2 parents 0fb4f45 + c94a985 commit 350f626

File tree

3 files changed

+104
-2
lines changed

3 files changed

+104
-2
lines changed

.github/workflows/upload-test.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Upload Test for Pypi.
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
linux:
8+
runs-on: ubuntu-latest
9+
10+
strategy:
11+
matrix:
12+
target: [aarch64]
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.10"
18+
cache: "pip"
19+
- run: pip install -r requirements.txt
20+
- name: Setup QEMU
21+
uses: docker/setup-qemu-action@v1
22+
if: ${{ matrix.target == 'aarch64' }}
23+
- name: Build wheels
24+
uses: PyO3/maturin-action@v1
25+
with:
26+
target: ${{ matrix.target }}
27+
maturin-version: "1.2.0"
28+
args: --release --out dist --find-interpreter
29+
sccache: "true"
30+
manylinux: ${{ matrix.target == 'aarch64' && 'manylinux_2_28' || 'auto' }}
31+
before-script-linux: |
32+
pip install uniffi-bindgen==0.24.1
33+
34+
# ISSUE: https://github.com/sfackler/rust-openssl/issues/2036#issuecomment-1724324145
35+
# If we're running on rhel centos, install needed packages.
36+
if command -v yum &> /dev/null; then
37+
yum update -y && yum install -y perl-core openssl openssl-devel pkgconfig libatomic
38+
39+
# If we're running on i686 we need to symlink libatomic
40+
# in order to build openssl with -latomic flag.
41+
if [[ ! -d "/usr/lib64" ]]; then
42+
ln -s /usr/lib/libatomic.so.1 /usr/lib/libatomic.so
43+
fi
44+
else
45+
# If we're running on debian-based system.
46+
apt update -y && apt-get install -y libssl-dev openssl pkg-config
47+
fi
48+
- name: Upload wheels
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: wheels-${{ matrix.target }}
52+
path: dist
53+
54+
sdist:
55+
runs-on: ubuntu-latest
56+
57+
steps:
58+
- uses: actions/checkout@v4
59+
- name: Build sdist
60+
uses: PyO3/maturin-action@v1
61+
with:
62+
command: sdist
63+
args: --out dist
64+
- name: Upload sdist
65+
uses: actions/upload-artifact@v4
66+
with:
67+
name: wheels
68+
path: dist
69+
70+
pypi-publish:
71+
name: upload release to PyPI
72+
runs-on: ubuntu-latest
73+
needs: [linux, sdist]
74+
75+
# Specifying a GitHub environment is optional, but strongly encouraged
76+
environment: testpublish
77+
permissions:
78+
# IMPORTANT: this permission is mandatory for Trusted Publishing
79+
id-token: write
80+
steps:
81+
# retrieve your distributions here
82+
- name: Checkout repository
83+
uses: actions/checkout@v4
84+
85+
- name: Download aarch64 wheels artifact
86+
uses: actions/download-artifact@v4
87+
with:
88+
name: wheels-aarch64
89+
90+
- name: Download sdist artifact
91+
uses: actions/download-artifact@v4
92+
with:
93+
name: sdist
94+
95+
- name: Publish package distributions to PyPI
96+
uses: pypa/gh-action-pypi-publish@release/v1
97+
with:
98+
repository-url: https://test.pypi.org/legacy/

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ crate-type = ["lib", "cdylib"]
1212
normal = ["openssl-src"]
1313

1414
[dependencies]
15-
c2pa = { version = "0.48.1", features = ["file_io", "pdf", "fetch_remote_manifests"]}
15+
c2pa = { version = "0.49.3", features = ["file_io", "pdf", "fetch_remote_manifests"]}
1616
thiserror = "1.0.49"
1717
uniffi = "0.28.2"
1818
openssl-src = "=300.3.1" # Required for openssl-sys

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,8 @@ build-python:
1515

1616
test:
1717
python3 ./tests/test_unit_tests.py
18-
python3 ./tests/test_api.py
18+
python3 ./tests/test_api.py
19+
20+
publish: release
21+
python3 -m pip install twine
22+
python3 -m twine upload dist/*

0 commit comments

Comments
 (0)