Skip to content

Commit 63f8a9c

Browse files
authored
ci: fix release staging and source artifact checks (#4216)
Main still uses the retired ATR endpoint and Rust macOS runner, and lacks the source SBOM and license-check fixes already merged into the release branch. This consolidates #4210, #4211, and #4212 into main while preserving its development versions. - Use the current ATR action and download URLs, and replace the retired macOS runner. - Generate, sign, checksum, and verify reproducible source SBOMs; add missing ASF headers and precise exclusions while preserving third-party notices. - Check Fory Nexus profile access before publication. Document that reusable fixes target main, version preparation stays local, and releases push immutable RC tags. Validation: formatting, Ruff, CLI help, shell syntax, and diff checks pass. The release builder and source workflow match the implementation validated in [the Linux signing/reproducibility run](https://github.com/apache/fory/actions/runs/42446804143), including byte-identical Linux/macOS output. Its CycloneDX schema, RAT, and lightweight license checks passed. All 97 checks on this main PR passed.
1 parent 4f79947 commit 63f8a9c

49 files changed

Lines changed: 1060 additions & 22 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.agents/skills/fory-release/SKILL.md‎

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ unless the user explicitly asks for a manual release. The workflow uses
1111
closure, or artifact-verification logic in shell commands. Do not add unrelated
1212
test runs.
1313

14+
Release automation, CI, and artifact-compliance fixes belong in PRs targeting
15+
`apache/main`. Merge those fixes before preparing the candidate. Keep the
16+
version-preparation branch local and push only the immutable RC tag; do not
17+
push a `releases-*` branch or target it with repair PRs unless the release
18+
manager explicitly requests that separate branch workflow.
19+
1420
## CI signing and staging prerequisites
1521

1622
The workflow runs only in `apache/fory` and uses these Infra-provisioned GitHub
@@ -25,6 +31,29 @@ Actions secrets:
2531
Source staging uses ATR with GitHub OIDC, not SVN credentials. Do not add a
2632
personal signing key, a GPG passphrase secret, or SVN credentials to this flow.
2733

34+
Source packaging requires Syft 1.57.0. CI installs this pinned version; install
35+
the same version on the trusted verification machine and put `syft` on `PATH`
36+
(or set `SYFT` to its executable path). The build emits a signed CycloneDX 1.6
37+
SBOM beside the source archive, with its own SHA-512 checksum. It inventories
38+
the manifests and lock files included in the archive; it is not a complete
39+
resolved dependency inventory for every runtime's binaries. Dependency
40+
enrichment is disabled and the source commit supplies the timestamp so the
41+
SBOM can be compared byte-for-byte during verification.
42+
43+
The source archive includes `.rat-excludes` for machine-readable metadata,
44+
bundled license texts, and specifically attributed third-party files. Keep
45+
third-party notices intact. The matching lightweight-check exclusions are in
46+
`.asf.yaml` under `project.policy.source_excludes_lightweight`. ASF synchronizes
47+
that policy from the default branch. After merging policy changes to
48+
`apache/main`, confirm the exact patterns are active in ATR before staging.
49+
Do not disable either license check or add broad source-directory exclusions.
50+
51+
The Nexus account must have staging access to the `org.apache.fory` profile.
52+
Provisioning the shared CI credentials alone does not grant access to this
53+
project. `stage_jvm` checks profile access before building or uploading artifacts;
54+
if it is missing, ask Infra to grant Fory staging access to the provisioned CI
55+
account. Do not replace the CI credentials with a personal account.
56+
2857
Before the first CI release, or after a signing-key rotation:
2958

3059
- Obtain the CI public key and its full primary fingerprint from Infra's message
@@ -58,7 +87,7 @@ Derive the release values:
5887
```bash
5988
release_branch="releases-${release_version}"
6089
rc_tag="v${release_version}-${rc}"
61-
release_candidate_url="https://release-test.apache.org/vote/fory/${release_version}"
90+
release_candidate_url="https://releases.apache.org/download/path/fory/${release_version}"
6291
```
6392

6493
### Find the release discussion
@@ -83,7 +112,7 @@ open and verify it instead of assuming it matches this release.
83112

84113
## Default CI Workflow
85114

86-
### 1. Create a clean release branch
115+
### 1. Create a clean local release branch
87116

88117
Run from the repository root. Clean means no staged, modified, or untracked files.
89118

@@ -116,7 +145,8 @@ test -z "$(git status --porcelain)"
116145
release_commit="$(git rev-parse HEAD)"
117146
```
118147

119-
Stage only the version changes produced by the release script.
148+
Stage only the version changes produced by the release script. Keep this
149+
version-preparation commit local until the RC tag is pushed in the next step.
120150

121151
### 4. Create and push the RC tag
122152

@@ -208,7 +238,7 @@ python3 ci/release.py verify_ci_artifacts \
208238
```
209239

210240
The command checks out the exact RC commit in a temporary clone, rebuilds the
211-
source archive and the complete JVM publication without signing or upload
241+
source archive, source SBOM, and complete JVM publication without signing or upload
212242
credentials, verifies the staged signatures with the public key, and compares
213243
every source, JAR, POM, source JAR, documentation JAR, and distribution file
214244
byte-for-byte. Each JVM ecosystem is built once and may reuse the machine's

‎.agents/skills/fory-release/references/manual-release.md‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ until the vote passes.
4545
Start from the clean release branch. Archive the exact RC tag without changing
4646
tracked files, creating commits, or moving refs. The root LICENSE and NOTICE
4747
must remain unchanged; benchmark attribution stays with the excluded benchmarks.
48+
Install the pinned Syft version specified in the main skill before building.
4849

4950
```bash
5051
test -z "$(git status --porcelain)"
@@ -55,15 +56,19 @@ test -z "$(git status --porcelain)"
5556
test -f "dist/apache-fory-${release_version}-src.tar.gz"
5657
test -f "dist/apache-fory-${release_version}-src.tar.gz.asc"
5758
test -f "dist/apache-fory-${release_version}-src.tar.gz.sha512"
59+
test -f "dist/apache-fory-${release_version}-src.tar.gz.cdx.json"
60+
test -f "dist/apache-fory-${release_version}-src.tar.gz.cdx.json.asc"
61+
test -f "dist/apache-fory-${release_version}-src.tar.gz.cdx.json.sha512"
5862
test "$(gzip -dc "dist/apache-fory-${release_version}-src.tar.gz" | git get-tar-commit-id)" = "$release_commit"
5963
```
6064

61-
The command verifies the generated PGP signature and SHA-512 checksum.
65+
The command verifies the PGP signatures and SHA-512 checksums of the source
66+
archive and its SBOM.
6267

6368
## Upload the Source Release to ASF Subversion
6469

6570
Use a clean, updated working copy of the ASF development distribution
66-
repository. Upload only the source archive, its signature, and its checksum.
71+
repository. Upload the source archive and its SBOM, each with its signature and checksum.
6772
Verification reports and logs are not distribution artifacts and must not be
6873
committed to SVN.
6974

@@ -75,6 +80,9 @@ mkdir -p "$svn_wc/$release_version"
7580
cp "dist/apache-fory-${release_version}-src.tar.gz" \
7681
"dist/apache-fory-${release_version}-src.tar.gz.asc" \
7782
"dist/apache-fory-${release_version}-src.tar.gz.sha512" \
83+
"dist/apache-fory-${release_version}-src.tar.gz.cdx.json" \
84+
"dist/apache-fory-${release_version}-src.tar.gz.cdx.json.asc" \
85+
"dist/apache-fory-${release_version}-src.tar.gz.cdx.json.sha512" \
7886
"$svn_wc/$release_version/"
7987
svn add --force "$svn_wc/$release_version"
8088
svn status "$svn_wc/$release_version"
@@ -85,7 +93,7 @@ svn ls "https://dist.apache.org/repos/dist/dev/fory/${release_version}/"
8593
```
8694

8795
Inspect `svn status` before committing. The upload is complete only after the
88-
commit returns a revision and remote `svn ls` shows all three source-release
96+
commit returns a revision and remote `svn ls` shows all six source-release
8997
files. For the vote template, set:
9098

9199
```bash

‎.asf.yaml‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,32 @@
1717

1818
# For more information, see https://cwiki.apache.org/confluence/display/INFRA/Git+-+.asf.yaml+features.
1919

20+
project:
21+
metadata:
22+
key: fory
23+
committee: fory
24+
name: Apache Fory
25+
policy:
26+
# These vendored files retain upstream notices documented in LICENSE.
27+
# Restrict exceptions to the matching files in Fory source archives.
28+
source_excludes_lightweight:
29+
- "/apache-fory-*-src.tar.gz/apache-fory-*-src/cpp/fory/thirdparty/MurmurHash3.cc"
30+
- "/apache-fory-*-src.tar.gz/apache-fory-*-src/cpp/fory/thirdparty/MurmurHash3.h"
31+
- "/apache-fory-*-src.tar.gz/apache-fory-*-src/java/fory-core/src/main/java/org/apache/fory/collection/ForyObjectMap.java"
32+
- "/apache-fory-*-src.tar.gz/apache-fory-*-src/java/fory-core/src/main/java/org/apache/fory/collection/IdentityMap.java"
33+
- "/apache-fory-*-src.tar.gz/apache-fory-*-src/java/fory-core/src/main/java/org/apache/fory/collection/IdentityObjectIntMap.java"
34+
- "/apache-fory-*-src.tar.gz/apache-fory-*-src/java/fory-core/src/main/java/org/apache/fory/collection/LongLongByteMap.java"
35+
- "/apache-fory-*-src.tar.gz/apache-fory-*-src/java/fory-core/src/main/java/org/apache/fory/collection/LongMap.java"
36+
- "/apache-fory-*-src.tar.gz/apache-fory-*-src/java/fory-core/src/main/java/org/apache/fory/collection/ObjectIntMap.java"
37+
- "/apache-fory-*-src.tar.gz/apache-fory-*-src/java/fory-core/src/main/java/org/apache/fory/reflect/TypeParameter.java"
38+
- "/apache-fory-*-src.tar.gz/apache-fory-*-src/java/fory-core/src/main/java/org/apache/fory/reflect/TypeRef.java"
39+
- "/apache-fory-*-src.tar.gz/apache-fory-*-src/java/fory-core/src/main/java/org/apache/fory/type/Generics.java"
40+
- "/apache-fory-*-src.tar.gz/apache-fory-*-src/java/fory-core/src/main/java/org/apache/fory/util/MurmurHash3.java"
41+
- "/apache-fory-*-src.tar.gz/apache-fory-*-src/java/fory-core/src/main/java/org/apache/fory/util/Preconditions.java"
42+
- "/apache-fory-*-src.tar.gz/apache-fory-*-src/java/fory-core/src/main/java/org/apache/fory/util/concurrency/DirectExecutorService.java"
43+
- "/apache-fory-*-src.tar.gz/apache-fory-*-src/java/fory-core/src/test/java/org/apache/fory/type/GenericsTest.java"
44+
- "/apache-fory-*-src.tar.gz/apache-fory-*-src/javascript/packages/core/lib/murmurHash3.ts"
45+
2046
github:
2147
description: >-
2248
A blazingly fast multi-language serialization framework for idiomatic domain objects, schema IDL, and cross-language data exchange.

‎.gitattributes‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
118
benchmarks export-ignore
219
# Compiler tests consume the shared IDL fixtures from released source archives.
320
integration_tests/* export-ignore

‎.github/workflows/ci.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ jobs:
150150
echo "graalvm_kotlin=false" >> "$GITHUB_OUTPUT"
151151
fi
152152
153-
if grep -Eq '^(rust/)' <<< "$changed_files"; then
153+
if grep -Eq '^(\.github/workflows/ci\.yml$|rust/)' <<< "$changed_files"; then
154154
echo "rust=true" >> "$GITHUB_OUTPUT"
155155
else
156156
echo "rust=false" >> "$GITHUB_OUTPUT"
@@ -1257,8 +1257,8 @@ jobs:
12571257
needs: changes
12581258
strategy:
12591259
matrix:
1260-
# macos-14 is the arm64 runner; keep it for Rust code changes only.
1261-
os: ${{ fromJSON(needs.changes.outputs.rust == 'true' && '["ubuntu-latest","macos-14","macos-latest"]' || '["ubuntu-latest","macos-latest"]') }}
1260+
# Exercise macOS 15 for Rust code and workflow changes.
1261+
os: ${{ fromJSON(needs.changes.outputs.rust == 'true' && '["ubuntu-latest","macos-15","macos-latest"]' || '["ubuntu-latest","macos-latest"]') }}
12621262
runs-on: ${{ matrix.os }}
12631263
timeout-minutes: 45
12641264
steps:

‎.github/workflows/stage-release-candidate.yml‎

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,17 +120,33 @@ jobs:
120120
printf '%s' "$FORY_GPG_SECRET_KEY" | \
121121
gpg --batch --import --import-options import-show
122122
123+
- name: Set up source SBOM generator
124+
id: syft
125+
shell: bash
126+
run: |
127+
set -euo pipefail
128+
syft_dir="$(mktemp -d)"
129+
curl --fail --location --retry 3 \
130+
https://github.com/anchore/syft/releases/download/v1.57.0/syft_1.57.0_linux_amd64.tar.gz \
131+
--output "$syft_dir/syft.tar.gz"
132+
printf '%s %s\n' \
133+
9c077a7d43029b3b13e98a8db720661e700c4d58db6352153a06395ae4a2a704 \
134+
"$syft_dir/syft.tar.gz" | sha256sum --check
135+
tar -xzf "$syft_dir/syft.tar.gz" -C "$syft_dir" syft
136+
echo "cmd=$syft_dir/syft" >> "$GITHUB_OUTPUT"
137+
123138
- name: Build source release
124139
shell: bash
125140
env:
141+
SYFT: ${{ steps.syft.outputs.cmd }}
126142
RC_TAG: ${{ needs.validate.outputs.rc-tag }}
127143
VERSION: ${{ needs.validate.outputs.version }}
128144
run: |
129145
set -euo pipefail
130146
python3 ci/release.py build -v "$VERSION" --rc-tag "$RC_TAG"
131147
132148
- name: Upload source release to ATR
133-
uses: apache/tooling-actions/upload-to-atr@ca6ed9e095c40db61c42a90db2599bb2fbc2319f
149+
uses: apache/tooling-actions/upload-to-atr@43a38c48536aaf8f29c58aed22d7ac9f170eced7
134150
with:
135151
project: fory
136152
version: ${{ needs.validate.outputs.version }}
@@ -143,7 +159,7 @@ jobs:
143159
{
144160
echo "### Source candidate"
145161
echo
146-
echo "https://release-test.apache.org/vote/fory/$VERSION"
162+
echo "https://releases.apache.org/download/path/fory/$VERSION"
147163
} >> "$GITHUB_STEP_SUMMARY"
148164
149165
stage-jvm:

‎.prettierignore‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
118
csharp/src/Fory.Generator/AnalyzerReleases.Unshipped.md

‎.rat-excludes‎

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
# Machine-readable metadata and generated lock files; licensed by the root LICENSE.
19+
.bazelversion
20+
go/fory/go.sum
21+
javascript/.prettierrc
22+
swift/.swift-format
23+
swift/Package.resolved
24+
csharp/src/Fory.Generator/AnalyzerReleases.Shipped.md
25+
csharp/src/Fory.Generator/AnalyzerReleases.Unshipped.md
26+
java/fory-annotation-processor/src/main/resources/META-INF/services/javax.annotation.processing.Processor
27+
java/fory-core/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker
28+
java/fory-latest-jdk-tests/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker
29+
kotlin/fory-json-kotlin-ksp/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider
30+
kotlin/fory-kotlin-ksp/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider
31+
32+
# Bundled license texts must retain the upstream wording.
33+
java/fory-core/src/main/resources/META-INF/licenses/LICENSE-janino.txt
34+
java/fory-core/src/main/resources/META-INF/licenses/LICENSE-kryo.txt
35+
licenses/LICENSE-kryo.txt
36+
37+
# Third-party sources retain the licenses and attribution listed in LICENSE.
38+
cpp/fory/thirdparty/MurmurHash3.cc
39+
cpp/fory/thirdparty/MurmurHash3.h
40+
java/fory-core/src/main/java/org/apache/fory/collection/ForyObjectMap.java
41+
java/fory-core/src/main/java/org/apache/fory/collection/IdentityMap.java
42+
java/fory-core/src/main/java/org/apache/fory/collection/IdentityObjectIntMap.java
43+
java/fory-core/src/main/java/org/apache/fory/collection/LongLongByteMap.java
44+
java/fory-core/src/main/java/org/apache/fory/collection/LongMap.java
45+
java/fory-core/src/main/java/org/apache/fory/collection/ObjectIntMap.java
46+
java/fory-core/src/main/java/org/apache/fory/type/Generics.java
47+
java/fory-core/src/main/java/org/apache/fory/util/MurmurHash3.java
48+
java/fory-core/src/test/java/org/apache/fory/type/GenericsTest.java
49+
javascript/packages/core/lib/murmurHash3.ts
50+
51+
# ATR stops applying its Git defaults when this file is present.
52+
**/.gitignore

‎.syft.yaml‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
# Scan only the source archive. Dependency resolution and host caches would make
19+
# the source SBOM depend on the machine and time at which it is rebuilt.
20+
check-for-app-update: false
21+
enrich: []
22+
java:
23+
use-network: false
24+
use-maven-local-repository: false
25+
golang:
26+
use-packages-lib: false
27+
search-local-mod-cache-licenses: false
28+
search-remote-licenses: false
29+
javascript:
30+
search-remote-licenses: false
31+
python:
32+
search-remote-licenses: false

‎.yamllint‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
118
extends: default
219

320
rules:

0 commit comments

Comments
 (0)