Skip to content
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
6a524af
chore: Updates c2pa_rs and leverages workspace versioning and depende…
gpeacock May 16, 2025
09ac4dd
chore: Another attempt at fixing the library release process
gpeacock May 16, 2025
3a04c6a
chore: repair capi_makefile - realpath was failing
gpeacock May 17, 2025
73e9153
chore: actually try to publish to the right tag
gpeacock May 17, 2025
ee37168
chore: allow overwrite and add ssl env vars for win
gpeacock May 17, 2025
6dd88cb
chore: try try try again
gpeacock May 17, 2025
575b73e
chore: if at first you fail, keep failing
gpeacock May 17, 2025
a877386
chore(c_api): The artifacts did not have correct content
gpeacock May 17, 2025
a283714
chore(c_api): fix the rpath and add universal debug symbols
gpeacock May 18, 2025
b1fa538
chore(c_api): add powershell script for windows
gpeacock May 19, 2025
2458b14
build: add linux arm build
gpeacock May 20, 2025
1b1b7ee
build: another approach to linux arm
gpeacock May 20, 2025
f851b53
build: restore the matrix
gpeacock May 20, 2025
084565d
build: fix cross comp
gpeacock May 20, 2025
d7dd1c3
build: add the magic x
gpeacock May 20, 2025
897eac8
build: add Maketext::Simple
gpeacock May 20, 2025
6196cc9
build: cross comp fix
gpeacock May 20, 2025
1871d18
build: go back to stripping debug symbols until someone asks for them
gpeacock May 20, 2025
108cafd
build: Another shot at a linux arm build
gpeacock May 20, 2025
71f150f
build: use the right kind of perl
gpeacock May 20, 2025
26a5f6d
build: do not use make for windows build
gpeacock May 20, 2025
5e7a193
build: use powershell for make on windows
gpeacock May 20, 2025
e086503
Merge branch 'main' into gpeacock/workspace_versions
gpeacock May 20, 2025
33035b5
chore: version
gpeacock May 20, 2025
5a5891a
build: c2pa_c libraries with native_rust_crypto
gpeacock May 21, 2025
d676f06
Merge branch 'main' into gpeacock/workspace_versions
gpeacock May 21, 2025
49a5f4b
chore: repair make test
gpeacock May 22, 2025
83aaaec
chore: clear warning
gpeacock May 22, 2025
1758b1a
fix: Fix CI.
cdmurph32 May 23, 2025
88f60f6
fix: remove c2pa-c from ci job feature selection.
cdmurph32 May 23, 2025
3ed5f01
build: fix the make release workflow
gpeacock May 23, 2025
411a3a1
Merge branch 'gpeacock/workspace_versions' of https://github.com/cont…
gpeacock May 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 27 additions & 60 deletions .github/workflows/library-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
tags:
- 'c2pa-v*' # Trigger on version tags (e.g., v1.0.0)
workflow_dispatch: # Allow manual triggering of the workflow
workflow_dispatch:

jobs:
build:
Expand All @@ -13,16 +13,13 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]
rust_version: [ stable ]
experimental: [ false ]
include:
- os: macos-latest
target: aarch64-apple-darwin

- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu

- os: windows-latest
target: x86_64-pc-windows-msvc

Expand All @@ -33,84 +30,54 @@ jobs:
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Setup Strawberry Perl
if: matrix.os == 'windows-latest'
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: '5.32'
distribution: 'strawberry'

# Install Locale::Maketext::Simple only on Windows with explicit paths
- name: Install Locale::Maketext::Simple and configure paths
- name: Build Windows release
if: matrix.os == 'windows-latest'
run: |
cpanm --verbose Locale::Maketext::Simple
# List installed modules to confirm installation
cpanm --info Locale::Maketext::Simple
# Display Perl's include paths
perl -e "print join(\"\n\", @INC);"
# Create a local copy in the expected path
perl -MLocale::Maketext::Simple -e "print \$INC{'Locale/Maketext/Simple.pm'}" > module_path.txt
$MODULE_PATH = Get-Content -Path module_path.txt
echo "Module found at: $MODULE_PATH"

# Create symbolic links to the modules in paths that are being checked
# Set environment variable for subsequent steps
echo "PERL5LIB=$env:PERL5LIB;D:\a\c2pa-rs\c2pa-rs\target\x86_64-pc-windows-msvc\release\build\openssl-sys-def693d178636927\out\openssl-build\build\src\util\perl" | Out-File -FilePath $env:GITHUB_ENV -Append
shell: pwsh

run: |
./setup-rust-openssl.ps1
- name: Build release
if: matrix.os != 'windows-latest'
run: make release

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.target }}-release
path: target/artifacts/*
name: release-artifacts-${{ matrix.os }}-${{ matrix.target }}
path: target/artifacts/

release:
needs: build
if: always()
runs-on: ubuntu-latest
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
pattern: release-artifacts-*
path: .
merge-multiple: true

- name: List downloaded artifacts
run: find . -type f | sort

run: ls -lh

- name: Extract tag_name from zip file
id: extract_tag
run: |
ZIP=$(ls c2pa-v*-*.zip | head -n1)
TAG_NAME=$(echo "$ZIP" | sed -E 's/^(c2pa-v[0-9]+\.[0-9]+\.[0-9]+)-.*\.zip/\1/')
echo "Found tag: $TAG_NAME"
echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT

- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
files: |
./ubuntu-latest-x86_64-unknown-linux-gnu-release/ubuntu-latest-x86_64-unknown-linux-gnu-release.tar.gz
./windows-latest-x86_64-pc-windows-msvc-release/windows-latest-x86_64-pc-windows-msvc-release.zip
./macos-latest-x86_64-apple-darwin-release/macos-latest-x86_64-apple-darwin-release.tar.gz
tag_name: ${{ steps.extract_tag.outputs.tag_name }}

files: ./*
draft: false
prerelease: false
prerelease: true
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create GitHub Release legacy
id: create_release_legacy
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
draft: true
prerelease: true

- name: Upload Release Assets old
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
for file in artifacts/*; do
echo "Uploading $file..."
gh release upload "${{ github.ref_name }}" "$file" --clobber
done

34 changes: 17 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ members = [
"sdk",
]

# members in this workspace can share this version setting
[workspace.package]
version = "0.51.1"

[workspace.dependencies]
c2pa = { path = "sdk", default-features = true }

[profile.release]
strip = true # Automatically strip symbols from the binary.
opt-level = 3
Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ ifeq ($(OS),Windows_NT)
PLATFORM := win
else
UNAME := $(shell uname)
ifeq ($(UNAME),Linux)
PLATFORM := linux
endif
ifeq ($(UNAME),Darwin)
PLATFORM := mac
endif
ifeq ($(UNAME),Linux)
PLATFORM := linux
endif
ifeq ($(UNAME),Darwin)
PLATFORM := mac
endif
endif

check-format:
Expand All @@ -22,7 +22,7 @@ clippy:
cargo clippy --features="file_io" --all-targets -- -D warnings

test-local:
cargo test --features="file_io, fetch_remote_manifests, add_thumbnails" --all-targets
cargo test --features="file_io, fetch_remote_manifests, add_thumbnails, v1_api" --all-targets
# Builds and views documentation

test-wasm:
Expand Down
15 changes: 8 additions & 7 deletions c_api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
[package]
name = "c2pa-c"
version = "0.49.5"
name = "c_api"
version.workspace = true
edition = "2021"
authors = ["Gavin Peacock <gpeacock@adobe.com>"]
license = "MIT OR Apache-2.0"

[lib]
name = "c2pa_c"
crate-type = ["cdylib"]

[features]
default = ["json_api", "openssl"]
json_api = ["c2pa/v1_api"]
openssl = ["c2pa/openssl"]
rust_native_crypto = ["c2pa/rust_native_crypto"]
file_io = ["c2pa/file_io"]
Comment thread
cdmurph32 marked this conversation as resolved.

[dependencies]
tokio = { version = "1.36", features = ["rt-multi-thread","rt"] }
c2pa = { path = "../sdk", version = "0.53.0", features = [
c2pa = { workspace = true , features = [

"file_io",
"add_thumbnails",
"fetch_remote_manifests",
], default-features = false }
]}
Comment thread
gpeacock marked this conversation as resolved.
scopeguard = "1.2.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
Expand All @@ -32,3 +32,4 @@ tempfile = "3.7.0"

[build-dependencies]
cbindgen = "0.28"

72 changes: 47 additions & 25 deletions c_api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,30 @@ ifeq ($(OS),Windows_NT)
PLATFORM := win
else
UNAME := $(shell uname)
ifeq ($(UNAME),Linux)
PLATFORM := linux
endif
ifeq ($(UNAME),Darwin)
PLATFORM := mac
endif
ifeq ($(UNAME),Linux)
PLATFORM := linux
endif
ifeq ($(UNAME),Darwin)
PLATFORM := mac
endif
endif

TARGET_DIR := $(realpath ../target)
TARGET_DIR := ../target

# Helper function to create a zip file
define make_zip
echo "Reading version from $(1)/c2pa.h"; \
if [ "$(PLATFORM)" = "win" ]; then \
VERSION=$$(findstr "^// Version:" $(1)/c2pa.h | awk -F": " "{print \$$2}"); \
else \
VERSION=$$(grep '^// Version:' $(1)/c2pa.h | sed 's/^\/\/ Version: //'); \
fi; \
ZIP_NAME=$(TARGET_DIR)/artifacts/c2pa-v$${VERSION}-$(2).zip; \
echo "Creating zip file: $${ZIP_NAME}"; \
mkdir -p $(TARGET_DIR)/artifacts $(1)/include $(1)/lib; \
cp $(1)/c2pa.h $(1)/include/; \
cp $(1)/libc2pa_c.* $(1)/lib/; \
cd $(1) && zip -r $${ZIP_NAME} include lib; \
echo "Zip file created: $${ZIP_NAME}"
set -e; \
echo "Reading version from $(1)/c2pa.h"; \
if [ "$(PLATFORM)" = "win" ]; then \
VERSION=$$(findstr "^// Version:" $(1)/c2pa.h | awk -F": " "{print \$$2}"); \
else \
VERSION=$$(grep '^// Version:' $(1)/c2pa.h | sed 's/^\/\/ Version: //'); \
fi; \
mkdir -p $(TARGET_DIR)/artifacts $(1)/include $(1)/lib; \
cp $(1)/c2pa.h $(1)/include/; \
cp $(1)/libc2pa_c.* $(1)/lib/; \
(cd $(1) && zip -9 -r ../../artifacts/c2pa-v$${VERSION}-$(2).zip include lib); \
echo "Zip file created: $(TARGET_DIR)/artifacts/c2pa-v$${VERSION}-$(2).zip"
endef

check-format:
Expand All @@ -52,28 +51,51 @@ fmt:
cargo +nightly fmt

# These are for building the c2patool release bin on various platforms
release-win:
release-win-x86_64:
rustup update stable-msvc
rustup target add x86_64-pc-windows-msvc
cargo build --target=x86_64-pc-windows-msvc --release
@$(call make_zip,$(TARGET_DIR)/x86_64-pc-windows-msvc/release,x86_64-pc-windows-msvc)
cargo build --target=x86_64-pc-windows-msvc --release --no-default-features --features "rust_native_crypto, file_io"
cargo test --target=x86_64-pc-windows-msvc --release ---no-default-features --features "rust_native_crypto, file_io"
# powershell -ExecutionPolicy Bypass -File ../../setup-rust-openssl.ps1

release-win-aarch64:
rustup update stable-msvc
rustup target add aarch64-pc-windows-msvc
cargo build --target=aarch64-pc-windows-msvc --release
# powershell -ExecutionPolicy Bypass -File ../../setup-rust-openssl.ps1

release-mac-arm:
rustup target add aarch64-apple-darwin
MACOSX_DEPLOYMENT_TARGET=11.1 cargo build --target=aarch64-apple-darwin --release
@$(call make_zip,$(TARGET_DIR)/aarch64-apple-darwin/release,aarch64-apple-darwin)
install_name_tool -id @rpath/libc2pa_c.dylib $(TARGET_DIR)/aarch64-apple-darwin/release/libc2pa_c.dylib

release-mac-x86:
rustup target add x86_64-apple-darwin
MACOSX_DEPLOYMENT_TARGET=10.15 cargo build --target=x86_64-apple-darwin --release
@$(call make_zip,$(TARGET_DIR)/x86_64-apple-darwin/release,x86_64-apple-darwin)
install_name_tool -id @rpath/libc2pa_c.dylib $(TARGET_DIR)/x86_64-apple-darwin/release/libc2pa_c.dylib

release-mac-universal: release-mac-arm release-mac-x86
rm -rf $(TARGET_DIR)/universal-apple-darwin
mkdir -p $(TARGET_DIR)/universal-apple-darwin/release
lipo -create -output $(TARGET_DIR)/universal-apple-darwin/release/libc2pa_c.dylib $(TARGET_DIR)/aarch64-apple-darwin/release/libc2pa_c.dylib ../target/x86_64-apple-darwin/release/libc2pa_c.dylib
cp $(TARGET_DIR)/aarch64-apple-darwin/release/c2pa.h $(TARGET_DIR)/universal-apple-darwin/release/c2pa.h
install_name_tool -id @rpath/libc2pa_c.dylib $(TARGET_DIR)/universal-apple-darwin/release/libc2pa_c.dylib
dsymutil $(TARGET_DIR)/universal-apple-darwin/release/libc2pa_c.dylib

cd $(TARGET_DIR)/universal-apple-darwin/release && \
zip -r9 libc2pa_c.dylib.dSYM.zip libc2pa_c.dylib.dSYM && \
rm -rf libc2pa_c.dylib.dSYM && \
ls -l

strip -x $(TARGET_DIR)/universal-apple-darwin/release/libc2pa_c.dylib
@$(call make_zip,$(TARGET_DIR)/universal-apple-darwin/release,universal-apple-darwin)

strip -x $(TARGET_DIR)/aarch64-apple-darwin/release/libc2pa_c.dylib
@$(call make_zip,$(TARGET_DIR)/aarch64-apple-darwin/release,aarch64-apple-darwin)

strip -x $(TARGET_DIR)/x86_64-apple-darwin/release/libc2pa_c.dylib
@$(call make_zip,$(TARGET_DIR)/x86_64-apple-darwin/release,x86_64-apple-darwin)

release-linux-gnu-x86:
rustup target add x86_64-unknown-linux-gnu
cargo build --target=x86_64-unknown-linux-gnu --release
Expand Down
Loading