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
70 changes: 70 additions & 0 deletions .github/workflows/exec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
on:
pull_request:
branches:
- main
paths:
- .github/workflows/exec.yaml
- system/exec/**
types:
- opened
- synchronize
- closed

env:
GRADLE_SUBPROJECT_DIR: system/exec
GRADLE_SUBPROJECT: ':system:exec'

defaults:
run:
shell: bash

jobs:
build:
runs-on: ubuntu-latest
if: github.event.pull_request.merged != true
steps:
- uses: actions/checkout@v7
- { uses: actions/setup-java@v5, with: { distribution: 'temurin', java-version: 25, cache: gradle } }
- { uses: gradle/actions/setup-gradle@v6, with: { cache-overwrite-existing: true } }
- run: './gradlew ${{ env.GRADLE_SUBPROJECT }}:build'

version:
runs-on: ubuntu-latest
outputs:
VERSION_CHANGED: ${{ steps.compare.outputs.VERSION_CHANGED }}
steps:
- { uses: actions/checkout@v7, with: { fetch-depth: 0 } }
- { uses: tj-actions/changed-files@v47, id: changed_files }
- run: |
file=${{ env.GRADLE_SUBPROJECT_DIR }}/version.txt
if ! echo '${{ steps.changed_files.outputs.modified_files }}' | tr ' ' '\n' | grep '^'${file}'$'
then
echo "VERSION_CHANGED=" | tee -a "${GITHUB_OUTPUT}"
else
echo "VERSION_CHANGED=1" | tee -a "${GITHUB_OUTPUT}"
fi
id: compare

publish:
permissions:
contents: read
id-token: write
needs:
- version
if: github.event.pull_request.merged == true && needs.version.outputs.VERSION_CHANGED != ''
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- { uses: actions/setup-java@v5, with: { distribution: 'temurin', java-version: 25, cache: gradle } }
- { uses: gradle/actions/setup-gradle@v6, with: { cache-overwrite-existing: true } }
- uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: 'us-east-1'
role-to-assume: arn:aws:iam::662610805887:role/prod-ssm-gha-read-maven-central-role
- run: |
params=$(aws ssm get-parameters-by-path --with-decryption --path /maven-central | jq -c)
eval $(echo "${params}" | jq -r '.Parameters[] | ("export " + (.Name | gsub("[/-]"; "_")) + "='"'"'" + (.Value | tojson) + "'"'"';")')
export ORG_GRADLE_PROJECT_mavenCentralUsername=$(echo ${_maven_central_token} | jq -r | grep -m1 -oP '(?<=<username>).*?(?=</username>)')
export ORG_GRADLE_PROJECT_mavenCentralPassword=$(echo ${_maven_central_token} | jq -r | grep -m1 -oP '(?<=<password>).*?(?=</password>)')
export ORG_GRADLE_PROJECT_signingInMemoryKey="$(echo ${_maven_central_key} | jq -r)"
./gradlew ${{ env.GRADLE_SUBPROJECT }}:publishToMavenCentral
16 changes: 4 additions & 12 deletions .github/workflows/picocli-logback-level-mixin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,13 @@ defaults:
jobs:
build:
runs-on: ubuntu-latest
if: github.event.pull_request.merged != true
steps:
- uses: actions/checkout@v7
- uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 25
cache: gradle
- { uses: actions/setup-java@v5, with: { distribution: 'temurin', java-version: 25, cache: gradle } }
- { uses: gradle/actions/setup-gradle@v6, with: { cache-overwrite-existing: true } }
- run: './gradlew ${{ env.GRADLE_SUBPROJECT }}:build'
if: github.event.pull_request.merged != true

version:
runs-on: ubuntu-latest
outputs:
Expand All @@ -53,17 +50,12 @@ jobs:
contents: read
id-token: write
needs:
- build
- version
if: github.event.pull_request.merged == true && needs.version.outputs.VERSION_CHANGED != ''
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 25
cache: gradle
- { uses: actions/setup-java@v5, with: { distribution: 'temurin', java-version: 25, cache: gradle } }
- { uses: gradle/actions/setup-gradle@v6, with: { cache-overwrite-existing: true } }
- uses: aws-actions/configure-aws-credentials@v4
with:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import com.vanniktech.maven.publish.Checksum
import com.vanniktech.maven.publish.DeploymentValidation
import com.vanniktech.maven.publish.*

plugins {
id 'info.ankin.projects.conventions'
Expand Down Expand Up @@ -27,6 +26,7 @@ aws ssm put-parameter --type SecureString --name /maven-central/key --value file
ORG_GRADLE_PROJECT_signingInMemoryKeyId=12345678 # Optional
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword=some_password # If key was created with a password.
*/

boolean propertiesSet() {
['mavenCentralUsername', 'mavenCentralPassword', 'signingInMemoryKey'].every {
project.providers.gradleProperty(it).isPresent()
Expand All @@ -35,6 +35,7 @@ boolean propertiesSet() {

if (propertiesSet())
mavenPublishing {
configure(new JavaLibrary(new JavadocJar.None(), new SourcesJar.Sources()))
// https://vanniktech.github.io/gradle-maven-publish-plugin/central/#uploading-with-automatic-publishing
publishToMavenCentral(true, DeploymentValidation.VALIDATED)
signAllPublications()
Expand Down
2 changes: 1 addition & 1 deletion system/exec/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.1-SNAPSHOT
0.0.1
Loading