Skip to content
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
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish to Maven Central

permissions:
contents: read

on:
release:
types: [created]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
Comment thread Fixed

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'Publish to Maven Central' step
Uses Step
uses 'gradle/actions/setup-gradle' with ref 'v3', not a pinned commit hash

- name: Run tests
run: ./gradlew test

- name: Publish to Maven Central
run: ./gradlew publish
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
Comment thread Fixed
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,10 @@ out/
# Compiled files
/bin/
/target/

# Sensitive files - NEVER commit these
*.gpg
*.asc
secring.*
gradle.properties.local
local.properties
13 changes: 10 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,24 @@ publishing {
}
repositories {
maven {
name = 'ossrh-staging-api'
name = 'central'
url = uri("https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/")
credentials {
username = USERNAME
password = PASSWORD
username = System.getenv('SONATYPE_USERNAME') ?: ''
password = System.getenv('SONATYPE_PASSWORD') ?: ''
}
}
}
}

signing {
def signingKeyId = System.getenv('SIGNING_KEY_ID')
def signingKey = System.getenv('GPG_PRIVATE_KEY')
def signingPassword = System.getenv('SIGNING_PASSWORD')

if (signingKey) {
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
}
sign publishing.publications.mavenJava
}

Expand Down
8 changes: 1 addition & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,4 @@ POM_ARTIFACT_ID=resend-java
POM_PACKAGING=jar
POM_ORGANIZATION_URL=https://resend.com

VENDOR_NAME=Resend. (https://resend.com)
USERNAME=${System.env.USERNAME}
PASSWORD=${System.env.PASSWORD}

signing.keyId=${System.env.signing.keyId}
signing.password=${System.env.signing.password}
signing.secretKeyRingFile=${System.env.signing.secretKeyRingFile}
VENDOR_NAME=Resend. (https://resend.com)
Loading