Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .changes/unreleased/release-workflows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: Changed
body: Verify release metadata and milestones, check security findings, support phased signed-tag enforcement, and use pinned workflow actions and changelog-derived release notes.
time: 2026-11-17T00:00:01Z
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "gradle"
directory: "/"
schedule:
Expand Down
4 changes: 4 additions & 0 deletions .github/signing-maintainers
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Intended release-tag signers. Public keys are resolved from each GitHub profile at check time.
goanpeca
ffumero2003
sophiecarreras
1 change: 0 additions & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ name: Changelog

on:
pull_request:
branches: [master, api-v2, 7.x]
push:
branches: [master]

Expand Down
79 changes: 53 additions & 26 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ on:
- api-v2
- 7.x # TODO: This is temporary and will be removed once we merge this branch to master branch

permissions:
contents: read

env:
OUTPUT_DIR: $GITHUB_WORKSPACE/build/outputs
OUTPUT_ZIP: b2-sdk-build-${GITHUB_RUN_NUMBER}.zip
OUTPUT_DIR: ${{ github.workspace }}/build/outputs
OUTPUT_ZIP: b2-sdk-build-${{ github.run_number }}.zip
BUILD_NUMBER: ${{ github.run_number }}
# These are stored in Bitwarden
B2_ACCOUNT_ID: ${{ secrets.B2_ACCOUNT_ID }}
Expand All @@ -25,22 +28,23 @@ jobs:
runs-on: ${{ github.repository == 'Backblaze/b2-sdk-java-private' && 'self-hosted'|| 'ubuntu-latest' }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
fetch-depth: 0
persist-credentials: false

- uses: actions/setup-java@v4
- uses: actions/setup-java@cf277c60eb25467037889841efdb72551f06f6c3 # v4
with:
distribution: temurin
java-version: '11'

- uses: gradle/actions/wrapper-validation@v4
- uses: gradle/actions/wrapper-validation@ed408507eac070d1f99cc633dbcf757c94c7933a # v4
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
uses: gradle/actions/setup-gradle@ed408507eac070d1f99cc633dbcf757c94c7933a # v4

# --- uv + Python 3.13, then create a venv in $RUNNER_TEMP ---
- name: Set up uv
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5
with:
enable-cache: false

Expand All @@ -64,23 +68,23 @@ jobs:

- name: Build the distribution
run: |
$GITHUB_WORKSPACE/gradlew build
mkdir -p ${{ env.OUTPUT_DIR }}
cp -v */build/libs/b2-sdk-*.{jar,pom,module} ${{ env.OUTPUT_DIR }}
cd ${{ env.OUTPUT_DIR }}
zip -r $GITHUB_WORKSPACE/build/${{ env.OUTPUT_ZIP }} *
"$GITHUB_WORKSPACE/gradlew" build
mkdir -p "$OUTPUT_DIR"
cp -v ./*/build/libs/b2-sdk-*.{jar,pom,module} "$OUTPUT_DIR"
cd "$OUTPUT_DIR"
zip -r "$GITHUB_WORKSPACE/build/$OUTPUT_ZIP" ./*

- name: Deploy to internal Maven repo
if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/api-v2' || github.ref == 'refs/heads/7.x') && github.repository == 'Backblaze/b2-sdk-java-private'
run: $GITHUB_WORKSPACE/gradlew publishMavenPublicationToRemoteRepository
run: '"$GITHUB_WORKSPACE/gradlew" publishMavenPublicationToRemoteRepository'
env:
ORG_GRADLE_PROJECT_remoteUsername: ${{ secrets.ARTIFACTORY_USERNAME }}
ORG_GRADLE_PROJECT_remotePassword: ${{ secrets.ARTIFACTORY_TOKEN }}
ORG_GRADLE_PROJECT_publishingUrl: "${{ secrets.JF }}/maven-private/"

- name: Deploy to GH packages
if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/api-v2' || github.ref == 'refs/heads/7.x') && github.repository == 'Backblaze/b2-sdk-java-private'
run: $GITHUB_WORKSPACE/gradlew publishMavenPublicationToRemoteRepository
run: '"$GITHUB_WORKSPACE/gradlew" publishMavenPublicationToRemoteRepository'
env:
ORG_GRADLE_PROJECT_remoteUsername: ${{ secrets.PACKAGES_USERNAME }}
ORG_GRADLE_PROJECT_remotePassword: ${{ secrets.PACKAGES_TOKEN }}
Expand All @@ -92,17 +96,40 @@ jobs:
export PATH="$UV_VENV/bin:$PATH"
"$GITHUB_WORKSPACE/maybe_upload_build_results" "${{ env.OUTPUT_ZIP }}"

- name: Check GitHub Pages status
if: github.ref == 'refs/heads/master'
uses: crazy-max/ghaction-github-status@v4
- name: Upload Javadoc artifact
if: >-
github.event_name == 'push' && github.repository == 'Backblaze/b2-sdk-java' &&
contains(fromJSON('["refs/heads/master", "refs/heads/api-v2", "refs/heads/7.x"]'), github.ref)
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3
with:
pages_threshold: major_outage

- name: Deploy Javadoc
if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/api-v2' || github.ref == 'refs/heads/7.x') && success()
uses: crazy-max/ghaction-github-pages@v3
path: core/build/docs/javadoc

deploy-pages:
needs: build
if: >-
github.event_name == 'push' && github.repository == 'Backblaze/b2-sdk-java' &&
contains(fromJSON('["refs/heads/master", "refs/heads/api-v2", "refs/heads/7.x"]'), github.ref)
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: github-pages
cancel-in-progress: false
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
target_branch: gh-pages
build_dir: core/build/docs/javadoc
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
persist-credentials: false
- name: Check GitHub Pages status
shell: bash
run: |
set -euo pipefail
curl --fail --show-error --silent --location --max-time 30 \
https://www.githubstatus.com/api/v2/components.json | python3 scripts/release.py pages-status
- name: Deploy Javadoc
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4
92 changes: 70 additions & 22 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,80 @@ on:
push:
tags: ['v*']

permissions:
contents: read

concurrency:
group: maven-central-${{ github.ref }}
cancel-in-progress: false

jobs:
release-checks:
if: github.repository == 'Backblaze/b2-sdk-java'
runs-on: ubuntu-latest
permissions:
contents: read
security-events: read
issues: read
env:
RELEASE_TAG: ${{ github.ref_name }}
steps:
# Read the key registry and gate implementation from the reviewed default branch.
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
ref: master
fetch-depth: 0
persist-credentials: false
- name: Verify release tag
env:
ENFORCE_SIGNED_TAGS: ${{ vars.ENFORCE_SIGNED_TAGS }}
GH_TOKEN: ${{ github.token }}
run: |
python3 scripts/release.py verify-commit "$RELEASE_TAG" "$GITHUB_SHA"
bash scripts/verify-release-tag.sh "$RELEASE_TAG"
- name: Check tag, version, and changelog agreement
run: |
git worktree add --detach "$RUNNER_TEMP/release-metadata" "$GITHUB_SHA"
python3 scripts/release.py --root "$RUNNER_TEMP/release-metadata" notes "$RELEASE_TAG" > /dev/null
- name: Require complete version milestone
env:
GH_TOKEN: ${{ github.token }}
run: python3 scripts/release.py milestone "$RELEASE_TAG"
- name: Require security clearance
env:
GH_TOKEN: ${{ secrets.RELEASE_READ_TOKEN }}
run: python3 scripts/release.py security

deploy:
name: Deploy
needs: release-checks
if: github.repository == 'Backblaze/b2-sdk-java'
runs-on: ubuntu-latest
permissions:
contents: write
env:
RELEASE_TAG: ${{ github.ref_name }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
ref: ${{ github.sha }}
fetch-depth: 0
persist-credentials: false

- uses: actions/setup-java@v4
- uses: actions/setup-java@cf277c60eb25467037889841efdb72551f06f6c3 # v4
with:
distribution: 'temurin'
java-version: '11'

- uses: gradle/actions/wrapper-validation@v4
- uses: gradle/actions/wrapper-validation@ed408507eac070d1f99cc633dbcf757c94c7933a # v4
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
uses: gradle/actions/setup-gradle@ed408507eac070d1f99cc633dbcf757c94c7933a # v4

- name: Build and test the release
run: ./gradlew build --no-daemon

- name: Extract release notes
run: python3 scripts/release.py notes "$RELEASE_TAG" > "$RUNNER_TEMP/release-notes.md"

- name: Deploy to Maven Central
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository createBundle --no-daemon --stacktrace
Expand All @@ -34,23 +90,15 @@ jobs:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_TOKEN_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_TOKEN_PASSWORD }}

- name: Get tag name
id: get_tag
shell: bash
run: |
tag_name="$(echo $GITHUB_REF | cut -d / -f 3)"
echo ::set-output name=tag::$tag_name

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_tag.outputs.tag }}
name: ${{ steps.get_tag.outputs.tag }}
prerelease: false
draft: false
files: |
core/build/libs/bundle-*.jar
httpclient/build/libs/bundle-*.jar
samples/build/libs/bundle-*.jar
GH_TOKEN: ${{ github.token }}
shell: bash
run: |
shopt -s nullglob
assets=(core/build/libs/bundle-*.jar httpclient/build/libs/bundle-*.jar samples/build/libs/bundle-*.jar)
[ "${#assets[@]}" -eq 3 ] || { echo 'Expected one release bundle for each module' >&2; exit 1; }
flags=(--latest)
if [[ "$RELEASE_TAG" == *-* ]]; then flags=(--prerelease); fi
gh release create "$RELEASE_TAG" --verify-tag --title "$RELEASE_TAG" \
--notes-file "$RUNNER_TEMP/release-notes.md" "${flags[@]}" "${assets[@]}"
52 changes: 52 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,36 @@ approach in [Blazer's release guide](https://github.com/Backblaze/blazer/blob/ma
Do not run a publishing task locally as a verification step. A tag push starts the production
deployment, including closing and releasing the Sonatype staging repository.

## Repository setup and signed-tag rollout

The intended release maintainers are `goanpeca`, `ffumero2003`, and `sophiecarreras`, listed in
`.github/signing-maintainers`. The verifier resolves their public keys from
`https://github.com/<username>.gpg`, `https://github.com/<username>.keys`, and the paginated public
`users/<username>/ssh_signing_keys` API at check time and runs
`git verify-tag` with an isolated keyring and SSH allowed-signers file. GitHub profile key changes
therefore affect the next verification; review the username list through a PR.

Tag verification is **warn-only by default**. Before enabling it, each intended signer must create a
GPG or SSH signing key and register the public key on their GitHub account. Confirm that their signed
tag passes verification, then run `gh variable set ENFORCE_SIGNED_TAGS --body true` for this repository.
Once enabled, an
unsigned, lightweight, unrecognized, or unverifiable tag blocks publication. In warn-only mode those
conditions produce a workflow warning; the security, milestone, and metadata gates still enforce.

An administrator must complete the following before the workflow changes are used for a release:

- Supply `RELEASE_READ_TOKEN`, a read-only token authorized for this repository's code-scanning,
Dependabot, secret-scanning alerts, repository security advisories (including drafts), and issues.
Enable these sources and grant access: a disabled or unreadable source holds publication.
The ordinary workflow token is used only for milestone reads and release creation, with explicit
job permissions; Maven signing/publishing secrets are exposed only to the publish step.
- Change Settings → Pages → Build and deployment → Source from **Deploy from a branch** to
**GitHub Actions**. Configure the `github-pages` environment to allow the documentation branches
`master`, `api-v2`, and `7.x`. The official Pages deployment uses GitHub OIDC with `pages: write`
and `id-token: write`; this does not change Maven Central authentication.
- Make `changelog-check` a required PR check and protect `.github/signing-maintainers` and the
release workflows through maintainer review. Keep Dependabot's GitHub Actions updates enabled.

## Changelog and versioning

Use semantic versioning: fixes use a patch release, compatible features a minor release, and
Expand Down Expand Up @@ -64,6 +94,19 @@ workflow files and human-authored changes still need a fragment.
including findings without a patched dependency. Failures to read findings are unverified,
not clean. A maintainer must resolve or dismiss findings with a written reason before release.

```bash
GH_TOKEN="$RELEASE_READ_TOKEN" python3 scripts/release.py security
# After the release-prep PR has merged, the milestone must contain no open issues or PRs:
python3 scripts/release.py milestone "$TAG"
```

The gate reads all pages of GitHub code-scanning alerts on `master`, Dependabot alerts,
draft/triage repository advisories, secret-scanning alerts, and severity-labeled open issues.
Medium/high/critical findings block even without a patched version; all open secret alerts
and unscored active advisories or code-scanning alerts block. Low findings do not block. The gate prints counts,
never unpublished advisory text or secret values. Do not put private advisory details in
a public issue. API failures are not a waiver; restore access and rerun the gate.

3. Batch the changelog and update the version in one operation:

```bash
Expand Down Expand Up @@ -131,6 +174,15 @@ The tag-triggered deploy workflow publishes using the existing Gradle command:
Maven Central, GPG artifact signing, the Sonatype staging endpoint, and the release/close tasks
are unchanged by the changelog tooling. Never run this production command as a dry-run substitute.

Before publishing, `release-checks` reads its gate implementation and maintainer list from `master`,
requires the tag to resolve to the workflow's immutable event commit on `master`, checks
version/changelog agreement, verifies the tag in the configured mode, and requires security clearance
and a complete `vX.Y.Z` milestone. Metadata validation and the `deploy` checkout use that same event
commit. `deploy` depends on those checks and runs the Gradle build before publishing. After successful
publication it runs `gh release create`
with the exact `.changes/vX.Y.Z.md` section as `--notes-file` and the three existing module bundles.
No default or automatically generated release body is used.

## Verify the published release

1. Inspect the deployment run for the tag and confirm the Sonatype close/release step succeeded:
Expand Down
Loading
Loading