Skip to content

Commit ab239a4

Browse files
committed
Merge remote-tracking branch 'origin/master' into claude/confident-ramanujan-MqHwi
# Conflicts: # Cargo.toml
2 parents bcc878f + f9b5c2f commit ab239a4

19 files changed

Lines changed: 858 additions & 42 deletions

File tree

.github/workflows/build-binaries.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ jobs:
8787
shell: bash
8888
run: |
8989
cargo build --release --target ${{ matrix.target }} -p pcf-debug
90+
cargo build --release --target ${{ matrix.target }} -p pcf-compact
9091
cargo build --release --target ${{ matrix.target }} -p pfs-ms --bin pfs
9192
9293
- name: Build (macOS universal2)
@@ -95,16 +96,21 @@ jobs:
9596
run: |
9697
for t in ${{ matrix.macos-targets }}; do
9798
cargo build --release --target "$t" -p pcf-debug
99+
cargo build --release --target "$t" -p pcf-compact
98100
cargo build --release --target "$t" -p pfs-ms --bin pfs
99101
done
100102
mkdir -p target/universal2-apple-darwin/release
101103
lipo -create -output target/universal2-apple-darwin/release/pcf-debug \
102104
target/x86_64-apple-darwin/release/pcf-debug \
103105
target/aarch64-apple-darwin/release/pcf-debug
106+
lipo -create -output target/universal2-apple-darwin/release/pcf-compact \
107+
target/x86_64-apple-darwin/release/pcf-compact \
108+
target/aarch64-apple-darwin/release/pcf-compact
104109
lipo -create -output target/universal2-apple-darwin/release/pfs \
105110
target/x86_64-apple-darwin/release/pfs \
106111
target/aarch64-apple-darwin/release/pfs
107112
file target/universal2-apple-darwin/release/pcf-debug
113+
file target/universal2-apple-darwin/release/pcf-compact
108114
file target/universal2-apple-darwin/release/pfs
109115
110116
- name: Stage and archive (unix)
@@ -114,7 +120,7 @@ jobs:
114120
VERSION='${{ needs.resolve-version.outputs.version }}'
115121
TARGET='${{ matrix.target }}'
116122
mkdir -p staging
117-
for bin in pcf-debug pfs; do
123+
for bin in pcf-debug pcf-compact pfs; do
118124
STAGE="staging/${bin}-${VERSION}-${TARGET}"
119125
mkdir -p "$STAGE"
120126
cp "target/${TARGET}/release/${bin}" "$STAGE/${bin}"
@@ -130,7 +136,7 @@ jobs:
130136
$version = '${{ needs.resolve-version.outputs.version }}'
131137
$target = '${{ matrix.target }}'
132138
New-Item -ItemType Directory -Force staging | Out-Null
133-
foreach ($bin in @('pcf-debug', 'pfs')) {
139+
foreach ($bin in @('pcf-debug', 'pcf-compact', 'pfs')) {
134140
$stage = "staging/$bin-$version-$target"
135141
New-Item -ItemType Directory -Force $stage | Out-Null
136142
Copy-Item "target/$target/release/$bin.exe" "$stage/$bin.exe"

.github/workflows/ci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,20 @@ jobs:
118118
- run: cargo clippy -p pcf-debug --all-targets -- -D warnings
119119
- run: cargo build -p pcf-debug --verbose
120120
- run: cargo test -p pcf-debug --verbose
121+
122+
pcf-compact:
123+
name: pcf-compact tool
124+
runs-on: ubuntu-latest
125+
defaults:
126+
run:
127+
working-directory: .
128+
steps:
129+
- uses: actions/checkout@v4
130+
- uses: dtolnay/rust-toolchain@stable
131+
with:
132+
components: rustfmt, clippy
133+
- uses: Swatinem/rust-cache@v2
134+
- run: cargo fmt -p pcf-compact -- --check
135+
- run: cargo clippy -p pcf-compact --all-targets -- -D warnings
136+
- run: cargo build -p pcf-compact --verbose
137+
- run: cargo test -p pcf-compact --verbose

.github/workflows/php-split.yml

Lines changed: 67 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@ on:
66
paths:
77
- 'implementations/php/**'
88
- '.github/workflows/php-split.yml'
9+
workflow_dispatch:
10+
inputs:
11+
tag:
12+
description: 'Tag to split (leave empty for branch-only split)'
13+
required: false
14+
type: string
15+
workflow_call:
16+
inputs:
17+
tag:
18+
description: 'Tag to split (leave empty for branch-only split)'
19+
required: false
20+
type: string
21+
default: ''
922

1023
jobs:
1124
split:
@@ -24,13 +37,64 @@ jobs:
2437
private-key: ${{ secrets.SPLIT_APP_PRIVATE_KEY }}
2538
owner: kduma-OSS-splits
2639

27-
- uses: danharrin/monorepo-split-github-action@v2.3.0
40+
- name: Initialize split repo if empty
41+
env:
42+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
43+
run: |
44+
set -euo pipefail
45+
REPO="kduma-OSS-splits/PHP-PCF-lib"
46+
TMPDIR=$(mktemp -d)
47+
git clone "https://x-access-token:${GH_TOKEN}@github.com/$REPO.git" "$TMPDIR" 2>&1 || true
48+
if ! git -C "$TMPDIR" rev-parse HEAD >/dev/null 2>&1; then
49+
echo "Repository $REPO is empty, initializing master with empty commit..."
50+
git -C "$TMPDIR" checkout -b master
51+
git -C "$TMPDIR" config user.name "github-actions[bot]"
52+
git -C "$TMPDIR" config user.email "41898282+github-actions[bot]@users.noreply.github.com"
53+
git -C "$TMPDIR" commit --allow-empty -m "Initial commit"
54+
git -C "$TMPDIR" push origin master
55+
else
56+
echo "Repository $REPO already has commits, skipping initialization"
57+
fi
58+
rm -rf "$TMPDIR"
59+
60+
- name: Resolve tag
61+
id: resolve-tag
62+
run: |
63+
if [[ -n "${{ inputs.tag }}" ]]; then
64+
echo "tag=${{ inputs.tag }}" >> "$GITHUB_OUTPUT"
65+
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
66+
echo "tag=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
67+
else
68+
echo "tag=" >> "$GITHUB_OUTPUT"
69+
fi
70+
71+
- name: Checkout tag
72+
if: steps.resolve-tag.outputs.tag != ''
73+
run: git checkout "refs/tags/${{ steps.resolve-tag.outputs.tag }}"
74+
75+
- name: Split (no tag)
76+
if: steps.resolve-tag.outputs.tag == ''
77+
uses: danharrin/monorepo-split-github-action@v2.4.0
78+
env:
79+
PAT: x-access-token:${{ steps.app-token.outputs.token }}
2880
with:
2981
package_directory: 'implementations/php'
3082
repository_organization: 'kduma-OSS-splits'
3183
repository_name: 'PHP-PCF-lib'
84+
branch: 'master'
3285
user_name: 'github-actions[bot]'
3386
user_email: '41898282+github-actions[bot]@users.noreply.github.com'
34-
branch: 'master'
87+
88+
- name: Split (with tag)
89+
if: steps.resolve-tag.outputs.tag != ''
90+
uses: danharrin/monorepo-split-github-action@v2.4.0
3591
env:
36-
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
92+
PAT: x-access-token:${{ steps.app-token.outputs.token }}
93+
with:
94+
tag: ${{ steps.resolve-tag.outputs.tag }}
95+
package_directory: 'implementations/php'
96+
repository_organization: 'kduma-OSS-splits'
97+
repository_name: 'PHP-PCF-lib'
98+
branch: 'master'
99+
user_name: 'github-actions[bot]'
100+
user_email: '41898282+github-actions[bot]@users.noreply.github.com'

.github/workflows/release-prepare.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,11 @@ jobs:
7676
sed -i 's/^version = "[^"]*"/version = "'"$NEW"'"/' reference/PCF-v1.0/Cargo.toml
7777
sed -i 's/^version = "[^"]*"/version = "'"$NEW"'"/' reference/PFS-MS-v1.0/Cargo.toml
7878
sed -i 's/^version = "[^"]*"/version = "'"$NEW"'"/' tools/pcf-debug/Cargo.toml
79+
sed -i 's/^version = "[^"]*"/version = "'"$NEW"'"/' tools/pcf-compact/Cargo.toml
7980
# path-dep version pins on pcf
8081
sed -i 's|pcf = { path = "\.\./PCF-v1.0", version = "[^"]*" }|pcf = { path = "../PCF-v1.0", version = "'"$NEW"'" }|' reference/PFS-MS-v1.0/Cargo.toml
8182
sed -i 's|pcf = { path = "\.\./\.\./reference/PCF-v1.0", version = "[^"]*" }|pcf = { path = "../../reference/PCF-v1.0", version = "'"$NEW"'" }|' tools/pcf-debug/Cargo.toml
83+
sed -i 's|pcf = { path = "\.\./\.\./reference/PCF-v1.0", version = "[^"]*" }|pcf = { path = "../../reference/PCF-v1.0", version = "'"$NEW"'" }|' tools/pcf-compact/Cargo.toml
8284
8385
- name: Bump TypeScript package
8486
shell: bash

.github/workflows/release.yml

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,19 @@ jobs:
128128
cargo publish -p pcf-debug --allow-dirty --token "${{ steps.cargo-auth.outputs.token }}"
129129
fi
130130
131+
- name: Wait for crates.io index
132+
if: needs.resolve.outputs.dry_run != 'true'
133+
run: sleep 45
134+
135+
- name: cargo publish pcf-compact
136+
shell: bash
137+
run: |
138+
if [ "${{ needs.resolve.outputs.dry_run }}" = "true" ]; then
139+
cargo publish -p pcf-compact --allow-dirty --dry-run
140+
else
141+
cargo publish -p pcf-compact --allow-dirty --token "${{ steps.cargo-auth.outputs.token }}"
142+
fi
143+
131144
publish-npm:
132145
name: Publish to npm
133146
needs: resolve
@@ -185,7 +198,7 @@ jobs:
185198
if: needs.resolve.outputs.dry_run != 'true'
186199
uses: NuGet/login@v1
187200
with:
188-
user: kduma
201+
user: krystianduma
189202
- name: dotnet nuget push
190203
if: needs.resolve.outputs.dry_run != 'true'
191204
run: |
@@ -205,28 +218,7 @@ jobs:
205218
name: Split PHP to packagist source repo
206219
needs: resolve
207220
if: needs.resolve.outputs.dry_run != 'true'
208-
runs-on: ubuntu-latest
209-
steps:
210-
- uses: actions/checkout@v4
211-
with:
212-
fetch-depth: 0
213-
214-
- name: Generate GitHub App token
215-
id: app-token
216-
uses: actions/create-github-app-token@v3
217-
with:
218-
app-id: ${{ secrets.SPLIT_APP_ID }}
219-
private-key: ${{ secrets.SPLIT_APP_PRIVATE_KEY }}
220-
owner: kduma-OSS-splits
221-
222-
- uses: danharrin/monorepo-split-github-action@v2.3.0
223-
with:
224-
package_directory: 'implementations/php'
225-
repository_organization: 'kduma-OSS-splits'
226-
repository_name: 'PHP-PCF-lib'
227-
user_name: 'github-actions[bot]'
228-
user_email: '41898282+github-actions[bot]@users.noreply.github.com'
229-
branch: 'master'
230-
tag: 'v${{ needs.resolve.outputs.version }}'
231-
env:
232-
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
221+
uses: ./.github/workflows/php-split.yml
222+
with:
223+
tag: v${{ needs.resolve.outputs.version }}
224+
secrets: inherit

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ members = [
55
"reference/PFS-MS-v1.0",
66
"reference/PCF-SIG-v1.0",
77
"tools/pcf-debug",
8+
"tools/pcf-compact",
89
]

implementations/dotnet/src/Pcf/Pcf.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<Description>Reader/writer for the Partitioned Container Format (PCF) v1.0.</Description>
1212

1313
<PackageId>KDuma.Pcf</PackageId>
14-
<Version>0.0.1</Version>
14+
<Version>0.0.5</Version>
1515
<Authors>Krystian Duma</Authors>
1616
<Company>kduma-OSS</Company>
1717
<Product>Partitioned Container Format</Product>

implementations/ts/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

implementations/ts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kduma-oss/pcf",
3-
"version": "0.0.1",
3+
"version": "0.0.5",
44
"description": "TypeScript implementation of the Partitioned Container Format (PCF) v1.0",
55
"license": "MIT OR Apache-2.0",
66
"author": "Krystian Duma",

reference/PCF-SIG-v1.0/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pcf-sig"
3-
version = "0.0.1"
3+
version = "0.0.5"
44
edition = "2021"
55
description = "Reference implementation of PCF-SIG v1.0, the PCF Cryptographic Signatures profile"
66
license = "MIT OR Apache-2.0"
@@ -17,7 +17,7 @@ categories = ["cryptography", "encoding"]
1717
[dependencies]
1818
# The PCF-SIG profile is layered strictly above PCF v1.0; every byte container
1919
# operation goes through the reference PCF crate.
20-
pcf = { path = "../PCF-v1.0", version = "0.0.1" }
20+
pcf = { path = "../PCF-v1.0", version = "0.0.5" }
2121

2222
# SHA-256 for key fingerprints and for the optional independent re-hash check
2323
# during verification. Pinned by the PCF crate already; we re-use it here.

0 commit comments

Comments
 (0)