From 818843a217adb52db1623a9e32a69d7b845dbc9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrique=20Lo=CC=81pez=20Man=CC=83as?= Date: Fri, 23 Jan 2026 17:13:46 +0100 Subject: [PATCH 1/2] build: fix release --- .github/workflows/release-please.yml | 61 +++++++--------------------- lint-checks/build.gradle | 6 +++ 2 files changed, 21 insertions(+), 46 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index c29066ee8..6c8cd17ad 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -1,54 +1,27 @@ -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: release-please +name: Publish on: - push: - branches: - - main - -permissions: - contents: write - pull-requests: write + release: + types: [published] jobs: - release-please: + publish: runs-on: ubuntu-latest steps: - - uses: googleapis/release-please-action@v4 - id: release + - name: Checkout + uses: actions/checkout@v5 with: token: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }} - # The steps below only run when a release PR is merged and a GitHub release is created - - name: Checkout - if: ${{ steps.release.outputs.release_created }} - uses: actions/checkout@v6 + - uses: gradle/actions/wrapper-validation@v4 - - name: Set up JDK 17 - if: ${{ steps.release.outputs.release_created }} - uses: actions/setup-java@v5 + - name: Set up JDK 21 + uses: actions/setup-java@v4.7.1 with: - java-version: '17' - distribution: 'temurin' + java-version: '21' + distribution: 'adopt' - - uses: gradle/actions/setup-gradle@v4 - if: ${{ steps.release.outputs.release_created }} - - - name: Set up Gradle Publishing Environment Variables - if: ${{ steps.release.outputs.release_created }} + - name: Create .gpg key run: | echo $GPG_KEY_ARMOR | base64 --decode > ./release.asc gpg --quiet --output $GITHUB_WORKSPACE/release.gpg --dearmor ./release.asc @@ -60,6 +33,7 @@ jobs: sed -i -e "s,signing.keyId=,signing.keyId=$GPG_KEY_ID,g" gradle.properties sed -i -e "s,signing.password=,signing.password=$GPG_PASSWORD,g" gradle.properties sed -i -e "s,signing.secretKeyRingFile=,signing.secretKeyRingFile=$GITHUB_WORKSPACE/release.gpg,g" gradle.properties + env: GPG_KEY_ARMOR: ${{ secrets.SYNCED_GPG_KEY_ARMOR }} GPG_KEY_ID: ${{ secrets.SYNCED_GPG_KEY_ID }} @@ -67,10 +41,5 @@ jobs: SONATYPE_TOKEN_PASSWORD: ${{ secrets.SONATYPE_TOKEN_PASSWORD }} SONATYPE_TOKEN_USERNAME: ${{ secrets.SONATYPE_TOKEN }} - - name: Build and Publish - if: ${{ steps.release.outputs.release_created }} - run: | - ./gradlew build --warn --stacktrace - ./gradlew publishToMavenCentral --warn --stacktrace --debug --info - env: - GH_TOKEN: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }} + - name: Publish to MavenCentral + run: ./gradlew publishToMavenCentral --warn --stacktrace \ No newline at end of file diff --git a/lint-checks/build.gradle b/lint-checks/build.gradle index b07d68867..bd1a712c1 100644 --- a/lint-checks/build.gradle +++ b/lint-checks/build.gradle @@ -45,4 +45,10 @@ jar { java { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 +} + +kotlin { + compilerOptions { + jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17) + } } \ No newline at end of file From 3004f361c12eac54aaabfd79f45afc3dfaf69d04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrique=20Lo=CC=81pez=20Man=CC=83as?= Date: Fri, 23 Jan 2026 17:18:01 +0100 Subject: [PATCH 2/2] build: fix release --- .github/workflows/publish.yml | 59 ++++++++++++++++++++++++++ .github/workflows/release-please.yml | 63 ++++++++++++---------------- 2 files changed, 85 insertions(+), 37 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..df46eaaa2 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,59 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Publish + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v5 + with: + token: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }} + + - uses: gradle/actions/wrapper-validation@v4 + + - name: Set up JDK 21 + uses: actions/setup-java@v4.7.1 + with: + java-version: '21' + distribution: 'adopt' + + - name: Create .gpg key + run: | + echo $GPG_KEY_ARMOR | base64 --decode > ./release.asc + gpg --quiet --output $GITHUB_WORKSPACE/release.gpg --dearmor ./release.asc + + echo "Build and publish" + sed -i -e "s,mavenCentralUsername=,mavenCentralUsername=$SONATYPE_TOKEN_USERNAME,g" gradle.properties + SONATYPE_TOKEN_PASSWORD_ESCAPED=$(printf '%s\n' "$SONATYPE_TOKEN_PASSWORD" | sed -e 's/[\/&]/\\&/g') + sed -i -e "s,mavenCentralPassword=,mavenCentralPassword=$SONATYPE_TOKEN_PASSWORD_ESCAPED,g" gradle.properties + sed -i -e "s,signing.keyId=,signing.keyId=$GPG_KEY_ID,g" gradle.properties + sed -i -e "s,signing.password=,signing.password=$GPG_PASSWORD,g" gradle.properties + sed -i -e "s,signing.secretKeyRingFile=,signing.secretKeyRingFile=$GITHUB_WORKSPACE/release.gpg,g" gradle.properties + + env: + GPG_KEY_ARMOR: ${{ secrets.SYNCED_GPG_KEY_ARMOR }} + GPG_KEY_ID: ${{ secrets.SYNCED_GPG_KEY_ID }} + GPG_PASSWORD: ${{ secrets.SYNCED_GPG_KEY_PASSWORD }} + SONATYPE_TOKEN_PASSWORD: ${{ secrets.SONATYPE_TOKEN_PASSWORD }} + SONATYPE_TOKEN_USERNAME: ${{ secrets.SONATYPE_TOKEN }} + + - name: Publish to MavenCentral + run: ./gradlew publishToMavenCentral --warn --stacktrace \ No newline at end of file diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 6c8cd17ad..76ddb5525 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -1,45 +1,34 @@ -name: Publish +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. on: - release: - types: [published] + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +name: release-please jobs: - publish: + release-please: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v5 + - uses: googleapis/release-please-action@v4 with: token: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }} - - - uses: gradle/actions/wrapper-validation@v4 - - - name: Set up JDK 21 - uses: actions/setup-java@v4.7.1 - with: - java-version: '21' - distribution: 'adopt' - - - name: Create .gpg key - run: | - echo $GPG_KEY_ARMOR | base64 --decode > ./release.asc - gpg --quiet --output $GITHUB_WORKSPACE/release.gpg --dearmor ./release.asc - - echo "Build and publish" - sed -i -e "s,mavenCentralUsername=,mavenCentralUsername=$SONATYPE_TOKEN_USERNAME,g" gradle.properties - SONATYPE_TOKEN_PASSWORD_ESCAPED=$(printf '%s\n' "$SONATYPE_TOKEN_PASSWORD" | sed -e 's/[\/&]/\\&/g') - sed -i -e "s,mavenCentralPassword=,mavenCentralPassword=$SONATYPE_TOKEN_PASSWORD_ESCAPED,g" gradle.properties - sed -i -e "s,signing.keyId=,signing.keyId=$GPG_KEY_ID,g" gradle.properties - sed -i -e "s,signing.password=,signing.password=$GPG_PASSWORD,g" gradle.properties - sed -i -e "s,signing.secretKeyRingFile=,signing.secretKeyRingFile=$GITHUB_WORKSPACE/release.gpg,g" gradle.properties - - env: - GPG_KEY_ARMOR: ${{ secrets.SYNCED_GPG_KEY_ARMOR }} - GPG_KEY_ID: ${{ secrets.SYNCED_GPG_KEY_ID }} - GPG_PASSWORD: ${{ secrets.SYNCED_GPG_KEY_PASSWORD }} - SONATYPE_TOKEN_PASSWORD: ${{ secrets.SONATYPE_TOKEN_PASSWORD }} - SONATYPE_TOKEN_USERNAME: ${{ secrets.SONATYPE_TOKEN }} - - - name: Publish to MavenCentral - run: ./gradlew publishToMavenCentral --warn --stacktrace \ No newline at end of file + config-file: release-please-config.json + manifest-file: .release-please-manifest.json \ No newline at end of file