Skip to content

Commit ff1a75b

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents fa3cea2 + 13fd9f0 commit ff1a75b

21 files changed

+497
-33
lines changed

.github/release-drafter.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Configuration for Release Drafter: https://github.com/toolmantim/release-drafter
2+
---
3+
4+
# Always use 3 digits for the version number
5+
name-template: $NEXT_PATCH_VERSION
6+
tag-template: $NEXT_PATCH_VERSION
7+
version-template: $MAJOR.$MINOR.$PATCH
8+
9+
categories:
10+
- title: 💥 Breaking changes
11+
labels:
12+
- breaking
13+
- title: ⚠️ Deprecated
14+
labels:
15+
- deprecated
16+
- title: 🚀 New features and improvements
17+
labels:
18+
- enhancement
19+
- feature
20+
- title: 🐛 Bug fixes
21+
labels:
22+
- bug
23+
- fix
24+
- bugfix
25+
- regression
26+
- regression-fix
27+
- title: 📝 Documentation updates
28+
labels:
29+
- documentation
30+
- title: 👻 Maintenance
31+
labels:
32+
- chore
33+
- internal
34+
- maintenance
35+
- title: 🚦 Tests
36+
labels:
37+
- test
38+
- tests
39+
- title: ✍ Other changes
40+
# Default label used by Dependabot
41+
- title: 📦 Dependency updates
42+
labels:
43+
- dependencies
44+
collapse-after: 15
45+
exclude-labels:
46+
- reverted
47+
- no-changelog
48+
- skip-changelog
49+
- invalid
50+
51+
template: |
52+
<!-- Optional: add a release summary here -->
53+
$CHANGES

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ jobs:
2020
maven-version: 3.9.9
2121
cache-enabled: true
2222

23-
- name: Maven deploy
23+
- name: Maven build
2424
run: mvn --batch-mode --update-snapshots verify
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Deploy Javadoc
2+
3+
on:
4+
workflow_call:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
deploy-javadoc:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
pages: write
18+
id-token: write
19+
steps:
20+
- name: Setup Maven Action
21+
uses: s4u/setup-maven-action@v1.18.0
22+
with:
23+
java-distribution: 'temurin'
24+
java-version: 17
25+
maven-version: 3.9.9
26+
cache-enabled: true
27+
28+
- name: Build javadoc
29+
run: mvn javadoc:javadoc
30+
31+
- name: Upload javadoc
32+
id: upload-javadoc
33+
uses: actions/upload-pages-artifact@v3
34+
with:
35+
path: target/reports/apidocs/
36+
37+
- name: Deploy to GitHub Pages
38+
id: deployment
39+
uses: actions/deploy-pages@v4
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
update_release_draft:
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: release-drafter/release-drafter@v6
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Release
2+
3+
on:
4+
workflow_call:
5+
6+
permissions:
7+
contents: read
8+
packages: write
9+
10+
jobs:
11+
deploy-release:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
packages: write
16+
steps:
17+
- name: Setup Maven Action
18+
uses: s4u/setup-maven-action@v1.18.0
19+
with:
20+
java-distribution: 'temurin'
21+
java-version: 17
22+
maven-version: 3.9.9
23+
cache-enabled: true
24+
25+
- name: Maven release
26+
run: mvn --batch-mode --update-snapshots -DtagNameFormat=@{project.version} -Dmaven.resolver.transport=wagon -DskipTests release:prepare release:perform
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Close draft release
31+
run: |
32+
release=$(gh api /repos/$GITHUB_REPOSITORY/releases | jq -e -r '[ .[] | select(.draft == true).id] | max')
33+
gh api -X PATCH -F draft=false -F name=$version -F tag_name=$version /repos/$GITHUB_REPOSITORY/releases/$release
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.mvn/maven.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
-Drevision=0.0.1-SNAPSHOT
1+
-Drevision=0.1.0-SNAPSHOT

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,36 @@
99

1010
OCI Registry as Storage enables libraries to push OCI Artifacts to [OCI Conformant](https://github.com/opencontainers/oci-conformance) registries. This is a Java SDK for Java developers to empower them to do this in their applications.
1111

12+
## Consuming SDK
13+
14+
SNAPSHOT version are published on GitHub Maven package.
15+
16+
Javadoc is published from main branch into: https://oras-project.github.io/oras-java/
17+
18+
GitHub requires authentication to download packages. You can use a personal access token to authenticate with GitHub Packages. To authenticate with GitHub Packages, you need to update your `~/.m2/settings.xml` file to include your personal access token.
19+
20+
```xml
21+
<server>
22+
<id>oras-java</id>
23+
<username>YOUR_USERNAME</username>
24+
<password>YOUR_ACCESS_TOKEN_WITH_PACKAGE_READ_SCOPE</password>
25+
</server>
26+
```
27+
28+
Then on your `pom.xml`
29+
30+
```xml
31+
<repositories>
32+
<repository>
33+
<id>oras-java</id>
34+
<url>https://maven.pkg.github.com/oras-project/oras-java</url>
35+
<snapshots>
36+
<enabled>true</enabled>
37+
</snapshots>
38+
</repository>
39+
</repositories>
40+
```
41+
1242
## Examples
1343

1444
### Push an Artifact

pom.xml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,18 @@
2525
<spotless.check.skip>false</spotless.check.skip>
2626
<enforcer.skip>false</enforcer.skip>
2727

28-
<maven.compiler.release>17</maven.compiler.release>
29-
3028
<!-- Version -->
3129
<slf4j.version>2.0.16</slf4j.version>
3230
<docker-java.version>3.4.1</docker-java.version>
3331
<jspecify.version>1.0.0</jspecify.version>
34-
<gson.version>2.11.0</gson.version>
32+
<gson.version>2.12.1</gson.version>
3533
<apache.common-compress.version>1.27.1</apache.common-compress.version>
3634

3735
<!-- Test dependencies version -->
3836
<logback.version>1.5.16</logback.version>
3937
<junit.version>5.11.4</junit.version>
4038
<testcontainer.version>1.20.4</testcontainer.version>
41-
<wiremock.version>3.10.0</wiremock.version>
39+
<wiremock.version>3.11.0</wiremock.version>
4240
<mockito.version>5.15.2</mockito.version>
4341
<system.stubs.version>2.1.7</system.stubs.version>
4442

@@ -48,6 +46,11 @@
4846
<maven-enforcer-plugin.version>3.5.0</maven-enforcer-plugin.version>
4947
<maven-javadoc-plugin.version>3.11.2</maven-javadoc-plugin.version>
5048

49+
<!-- Target Java 17 -->
50+
<maven.compiler.source>17</maven.compiler.source>
51+
<maven.compiler.target>17</maven.compiler.target>
52+
<maven.compiler.release>17</maven.compiler.release>
53+
5154
</properties>
5255

5356
<dependencyManagement>
@@ -200,6 +203,7 @@
200203
<phase>verify</phase>
201204
<configuration>
202205
<show>public</show>
206+
<failOnWarnings>true</failOnWarnings>
203207
</configuration>
204208
</execution>
205209
</executions>

src/main/java/land/oras/Annotations.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public record Annotations(
2222
/**
2323
* Create a new annotations record with only manifest annotations
2424
* @param manifestAnnotations The manifest annotations
25+
* @return The annotations
2526
*/
2627
public static Annotations ofManifest(Map<String, String> manifestAnnotations) {
2728
return new Annotations(new HashMap<>(), manifestAnnotations, new HashMap<>());

src/main/java/land/oras/Registry.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,7 @@ private boolean switchTokenAuth(OrasHttpClient.ResponseWrapper<String> response)
573573
private void handleError(OrasHttpClient.ResponseWrapper<?> responseWrapper) {
574574
if (responseWrapper.statusCode() >= 400) {
575575
if (responseWrapper.response() instanceof String) {
576+
LOG.debug("Response: {}", responseWrapper.response());
576577
throw new OrasException((OrasHttpClient.ResponseWrapper<String>) responseWrapper);
577578
}
578579
throw new OrasException(new OrasHttpClient.ResponseWrapper<>("", responseWrapper.statusCode(), Map.of()));

0 commit comments

Comments
 (0)