Skip to content
Closed
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
103 changes: 0 additions & 103 deletions .github/workflows/.ci_cd.yml

This file was deleted.

25 changes: 10 additions & 15 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@ jobs:
if: github.repository == 'Backblaze/b2-sdk-java'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Use jdk8
uses: actions/setup-java@v2
- uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '8'
cache: 'gradle'
distribution: 'temurin'
java-version: '11'

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

- uses: gradle/wrapper-validation-action@v1
- name: Deploy to Maven Central
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository createBundle --no-daemon --stacktrace
env:
Expand All @@ -33,21 +34,15 @@ jobs:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}

- name: Cleanup Gradle Cache
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -fr ~/.gradle/caches/*/plugin-resolution/

- 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@v1
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ hs_err_pid*
.DS_Store

!gradle/wrapper/gradle-wrapper.jar
.github/workflows/ci_cd.yml
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog
## [Unreleased] - TBD
### Added
* Close idle connections after 4 seconds.
* Add `readBucketLogging` and `writeBucketLogging` capabilities.

## [6.3.0] - 2024-11-08
### Added
* Fixed `B2StorageClient.deleteAllFilesInBucket` so it uses `fileVersions` instead of `fileNames`.
Expand Down
14 changes: 9 additions & 5 deletions buildSrc/src/main/kotlin/b2sdk.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ publishing {
groupId = project.group.toString()
artifactId = project.name

if (System.getenv("RELEASE_BUILD") != null) {
version = project.version.toString()
version = if (System.getenv("RELEASE_BUILD") != null) {
project.version.toString()
} else {
version = when (val buildNum = System.getenv("BUILD_NUMBER")) {
when (val buildNum = System.getenv("BUILD_NUMBER")) {
null -> project.version.toString()
else -> "${project.version}+$buildNum"
}
Expand Down Expand Up @@ -134,6 +134,10 @@ publishing {
}

repositories {
maven("https://artifactory.backblaze.com/artifactory/maven-private/") {
name = "bzArtifactory"
credentials(PasswordCredentials::class)
}
maven("https://maven.pkg.github.com/Backblaze/repo") {
name = "bzGithubPackages"
credentials(PasswordCredentials::class)
Expand All @@ -144,8 +148,8 @@ publishing {
val sonatypeUsername = findProperty("sonatypeUsername")
val sonatypePassword = findProperty("sonatypePassword")

val gpgSigningKey = System.getenv("GPG_SIGNING_KEY")
val gpgPassphrase = System.getenv("GPG_PASSPHRASE")
val gpgSigningKey: String? = System.getenv("GPG_SIGNING_KEY")
val gpgPassphrase: String? = System.getenv("GPG_PASSPHRASE")

if (sonatypeUsername != null && sonatypePassword != null) {
signing {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public interface B2Capabilities {

String READ_BUCKET_ENCRYPTION = "readBucketEncryption";
String WRITE_BUCKET_ENCRYPTION = "writeBucketEncryption";

String READ_BUCKET_LOGGING = "readBucketLogging";
String WRITE_BUCKET_LOGGING = "writeBucketLogging";

String BYPASS_GOVERNANCE = "bypassGovernance";
String READ_BUCKET_RETENTIONS = "readBucketRetentions";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public void testEquals() {
capabilities.add(B2Capabilities.WRITE_BUCKET_RETENTIONS);
capabilities.add(B2Capabilities.READ_FILE_RETENTIONS);
capabilities.add(B2Capabilities.WRITE_FILE_RETENTIONS);
capabilities.add(B2Capabilities.READ_BUCKET_LOGGING);
capabilities.add(B2Capabilities.WRITE_BUCKET_LOGGING);
capabilities.add(B2Capabilities.READ_FILE_LEGAL_HOLDS);
capabilities.add(B2Capabilities.WRITE_FILE_LEGAL_HOLDS);
capabilities.add(B2Capabilities.READ_BUCKET_REPLICATIONS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ public CloseableHttpClient create() throws B2Exception {
.setUserAgent(APACHE_HTTP_CLIENT_USER_AGENT)
.setConnectionManager(connectionManager)
.setDefaultRequestConfig(requestConfig)
// Allow connections to be idle for up to 4 seconds before not reusing. This strategy is needed
// because we are seeing connections being closed by the server after 4 seconds, then when we attempt
// to use, the call fails.
.setKeepAliveStrategy((httpResponse, httpContext) -> 4000)
.build();
}

Expand Down