From f1f5b553e865e32d8efd808d219c812bc97e4644 Mon Sep 17 00:00:00 2001 From: manikandan-ravikumar Date: Thu, 18 Dec 2025 09:44:03 +0200 Subject: [PATCH 1/3] feat: migrate from maven github packages to AWS code artifact --- .../workflows/publish-to-code-artifact.yml | 48 +++++++++++++++++++ build.gradle | 9 ++-- 2 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/publish-to-code-artifact.yml diff --git a/.github/workflows/publish-to-code-artifact.yml b/.github/workflows/publish-to-code-artifact.yml new file mode 100644 index 0000000..47d2e82 --- /dev/null +++ b/.github/workflows/publish-to-code-artifact.yml @@ -0,0 +1,48 @@ +name: Publish to CodeArtifact + +on: + release: + types: [published] + +env: + AWS_REGION: us-east-1 + +jobs: + publish: + runs-on: + group: Infrastructure + labels: [self-hosted, linux, arm64] + + steps: + - name: Checkout code + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@b547701ef94ff7a3c3d8ea1eead705e6ceaf3871 # v5.1.1 + with: + aws-region: ${{ env.AWS_REGION }} + + - name: Set up JDK + uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0 + with: + java-version: '17' + distribution: 'corretto' + + - name: Login to CodeArtifact + run: | + export CODEARTIFACT_AUTH_TOKEN=$(aws codeartifact get-authorization-token \ + --domain ${{ vars.CODEARTIFACT_DOMAIN }} \ + --domain-owner ${{ vars.CODEARTIFACT_DOMAIN_OWNER }} \ + --region ${{ env.AWS_REGION }} \ + --query authorizationToken \ + --output text) + echo "CODEARTIFACT_AUTH_TOKEN=$CODEARTIFACT_AUTH_TOKEN" >> $GITHUB_ENV + + - name: Build with Gradle + run: ./gradlew build + + - name: Run tests + run: ./gradlew test + + - name: Publish to CodeArtifact + run: ./gradlew publish diff --git a/build.gradle b/build.gradle index b9bc8a3..bce63c6 100644 --- a/build.gradle +++ b/build.gradle @@ -165,9 +165,12 @@ allprojects { project -> publishing { repositories { maven { - name = "github" - url = uri("https://maven.pkg.github.com/nosto/beanie") - credentials(PasswordCredentials) + name = "codeartifact" + url = uri("https://nosto-673366506863.d.codeartifact.us-east-1.amazonaws.com/maven/java/") + credentials { + username = "aws" + password = System.getenv("CODEARTIFACT_AUTH_TOKEN") + } } } publications { From e70cf264a27289117cf4e0a83e81940c71879969 Mon Sep 17 00:00:00 2001 From: manikandan-ravikumar Date: Thu, 18 Dec 2025 09:51:00 +0200 Subject: [PATCH 2/3] chore: update readme to reflect code artifactory repo --- README.md | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9567fbd..5eb5590 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,32 @@ Beanie is a simple library to sanity-check your bean ser-deser. Beanie catches a ## Installation -Unfortunately, Beanie is not available in any public Maven repositories except the GitHub Package Registry. For more information on how to install packages -from the GitHub Package -Registry, [https://docs.github.com/en/packages/guides/configuring-gradle-for-use-with-github-packages#installing-a-package][see the GitHub docs] +Beanie artifacts are published to AWS CodeArtifact. Before building, fetch a temporary token and expose it to Gradle (tokens expire after 12 hours): + +``` +export CODEARTIFACT_AUTH_TOKEN=$(aws codeartifact get-authorization-token \ + --domain \ + --domain-owner \ + --region us-east-1 \ + --query authorizationToken \ + --output text) +``` + +Then add the CodeArtifact repository to your `repositories` block: + +``` +repositories { + maven { + url = uri("https://nosto-673366506863.d.codeartifact.us-east-1.amazonaws.com/maven/java/") + credentials { + username = "aws" + password = System.getenv("CODEARTIFACT_AUTH_TOKEN") + } + } +} +``` + +After the repository is configured, declare the Beanie modules you need in `dependencies` as usual. ## Usage From 0ed10de9ba49d9e73a666acfb22ec3cd539864a5 Mon Sep 17 00:00:00 2001 From: manikandan-ravikumar Date: Mon, 22 Dec 2025 16:34:54 +0200 Subject: [PATCH 3/3] fix: remove the redundant configure-aws-credentials --- .github/workflows/publish-to-code-artifact.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/publish-to-code-artifact.yml b/.github/workflows/publish-to-code-artifact.yml index 47d2e82..3560a3d 100644 --- a/.github/workflows/publish-to-code-artifact.yml +++ b/.github/workflows/publish-to-code-artifact.yml @@ -17,11 +17,6 @@ jobs: - name: Checkout code uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@b547701ef94ff7a3c3d8ea1eead705e6ceaf3871 # v5.1.1 - with: - aws-region: ${{ env.AWS_REGION }} - - name: Set up JDK uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0 with: