Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(v2): publish snapshots #1655

Merged
merged 18 commits into from
Jun 24, 2024
Merged
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
40 changes: 40 additions & 0 deletions .github/workflows/docs-v2-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Docs
on:
push:
branches:
- v2
workflow_dispatch: {}

permissions:
id-token: write
contents: write
pages: write

jobs:
docs:
runs-on: ubuntu-latest
environment: Docs
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Set up Python
uses: actions/setup-python@bd6b4b6205c4dbad673328db7b31b7fab9e241c0 # v4.6.1
with:
python-version: "3.8"
- name: Capture branch and tag
id: branch_name
run: |
echo "SOURCE_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
echo "SOURCE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Build docs website
run: |
make build-docs-website
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef
with:
aws-region: us-east-1
role-to-assume: ${{ secrets.AWS_DOCS_ROLE_ARN }}
- name: Deploy Docs
run: |
aws s3 sync \
dist \
s3://${{ secrets.AWS_DOCS_BUCKET }}/lambda-java/preview/
29 changes: 29 additions & 0 deletions .github/workflows/publish-v2-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Publish v2
on:
push:
branches:
- v2
workflow_dispatch: {}
jobs:
publish:
runs-on: ubuntu-latest
environment: snapshot
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Set up Maven Central Repository
uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0
with:
distribution: 'corretto'
java-version: 11
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
# TODO: use environments https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment
gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }} # Value of the GPG private key to import
gpg-passphrase: GPG_PASSPHRASE # env variable for GPG private key passphrase
- name: Publish package
run: mvn -Prelease clean validate deploy -DskipTests # We use validate here to run maven enforcer, to make sure we are only publishing SNAPSHOT builds
env:
MAVEN_USERNAME: ${{ secrets.SNAPSHOT_PUBLISH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.SNAPSHOT_PUBLISH_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
- name: Publish package
run: mvn -Prelease clean deploy -DskipTests
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_JIRA_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_JIRA_PASSWORD }}
MAVEN_USERNAME: ${{ secrets.SNAPSHOT_PUBLISH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.SNAPSHOT_PUBLISH_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Close issues related to this release
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
Expand Down
8 changes: 7 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ title: Homepage
description: Powertools for AWS Lambda (Java)
---

![aws provider](https://img.shields.io/badge/provider-AWS-orange?logo=amazon-aws&color=ff9900) ![Build status](https://github.com/aws-powertools/powertools-lambda-java/actions/workflows/build.yml/badge.svg) ![Maven Central](https://img.shields.io/maven-central/v/software.amazon.lambda/powertools-parent)
![aws provider](https://img.shields.io/badge/provider-AWS-orange?logo=amazon-aws&color=ff9900) ![Build status](https://github.com/aws-powertools/powertools-lambda-java/actions/workflows/publish-v2-snapshot.yml/badge.svg) ![Maven Central](https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Faws.oss.sonatype.org%2Fcontent%2Frepositories%2Fsnapshots%2Fsoftware%2Famazon%2Flambda%2Fpowertools-parent%2Fmaven-metadata.xml
)

???+ warning
You are browsing the documentation for Powertools for AWS Lambda (Java) - v2. This is a snapshot release and not stable!
Check out our stable [v1](https://docs.powertools.aws.dev/lambda/java/) documentation if this is not what you wanted.
The v2 maven snapshot repository can be found [here](https://aws.oss.sonatype.org/content/repositories/snapshots/software/amazon/lambda/) .

Powertools for AWS Lambda (Java) is a suite of utilities for AWS Lambda Functions that makes tracing with AWS X-Ray, structured logging and creating custom metrics asynchronously easier.

Expand Down
9 changes: 9 additions & 0 deletions examples/powertools-examples-core-utilities/sam/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,15 @@
</dependency>
</dependencies>
</plugin>
<!-- Don't deploy the example -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.2</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,15 @@
</dependency>
</dependencies>
</plugin>
<!-- Don't deploy the example -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.2</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
6 changes: 3 additions & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
site_name: Powertools for AWS Lambda (Java)
site_description: Powertools for AWS Lambda (Java)
site_name: Powertools for AWS Lambda (Java) Preview
site_description: Powertools for AWS Lambda (Java) Preview
site_author: Amazon Web Services
site_url: https://docs.powertools.aws.dev/lambda-java/
nav:
Expand Down Expand Up @@ -85,7 +85,7 @@ extra_javascript:

extra:
powertools:
version: 2.0.0 # to update after each release (we do not want snapshot version here)
version: 2.0.0-SNAPSHOT

repo_url: https://github.com/aws-powertools/powertools-lambda-java
edit_uri: edit/main/docs
29 changes: 29 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@
<project.rootdir>${maven.multiModuleProjectDirectory}</project.rootdir>
</properties>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://aws.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>

<dependencyManagement>
<dependencies>
<dependency>
Expand Down Expand Up @@ -457,6 +464,28 @@
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<id>enforce-snapshot-versions</id>
<phase>validate</phase>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireSnapshotVersion>
<message>Release build should not have snapshot dependencies!</message>
</requireSnapshotVersion>
</rules>
<fail>true</fail>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"installationId":"e43b8515-8484-485c-8315-bead4568972b","telemetryEnabled":"true"}
16 changes: 16 additions & 0 deletions spotbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,22 @@
https://spotbugs.readthedocs.io/en/latest/bugDescriptions.html
-->
<FindBugsFilter>
<!-- These open matches are new rules that we have not yet addressed. Let's block them generically, and come
jeromevdl marked this conversation as resolved.
Show resolved Hide resolved
back to them later. -->
<Match>
<Bug pattern="CT_CONSTRUCTOR_THROW" />
</Match>
<Match>
<Bug pattern="PA_PUBLIC_PRIMITIVE_ATTRIBUTE" />
</Match>
<Match>
<Bug pattern="SING_SINGLETON_GETTER_NOT_SYNCHRONIZED" />
</Match>
<Match>
<Bug pattern="SING_SINGLETON_GETTER_NOT_SYNCHRONIZED" />
</Match>

<!-- Regular matches -->
<Match>
<Bug pattern="EI_EXPOSE_REP2"/>
<Or>
Expand Down
Loading