From a66f9e31741e43c1c2603aff9f76577927dea1f6 Mon Sep 17 00:00:00 2001 From: Bart Hazer Date: Tue, 28 May 2024 10:50:34 -0700 Subject: [PATCH 1/4] chore: delete unsued publish workflow --- .github/workflows/publish.yml | 49 ----------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index e848a77..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,49 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -name: Publish to Maven Central Repository -on: - workflow_dispatch: - release: - types: [created] -jobs: - publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Java - uses: actions/setup-java@v2 - with: - java-version: '11' - distribution: 'adopt' - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - name: Validate Gradle wrapper - uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b - - name: Create .gpg key - run: | - echo $GPG_KEY_ARMOR | base64 --decode > ./release.asc - gpg --quiet --output $GITHUB_WORKSPACE/release.gpg --dearmor ./release.asc - SONATYPE_PASSWORD_ESCAPED=$(printf '%s\n' "$SONATYPE_PASSWORD" | sed -e 's/[\/&]/\\&/g') - sed -i -e "s,sonatypeUsername=,sonatypeUsername=$SONATYPE_USERNAME,g" gradle.properties - sed -i -e "s,sonatypePassword=,sonatypePassword=$SONATYPE_PASSWORD_ESCAPED,g" gradle.properties - sed -i -e "s,githubPassword=,githubPassword=$GITHUB_PASSWORD,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_PASSWORD: '${{ secrets.SYNCED_SONATYPE_PASSWORD }}' - SONATYPE_USERNAME: ${{ secrets.SYNCED_SONATYPE_USERNAME }} - GITHUB_PASSWORD: '${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}' - - name: Publish package - uses: gradle/gradle-build-action@4137be6a8bf7d7133955359dbd952c0ca73b1021 - with: - arguments: publish - env: - MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} From 3819a11b0c3cc5b4b1e874d7ecd54cebb660e2b3 Mon Sep 17 00:00:00 2001 From: Bart Hazer Date: Tue, 28 May 2024 10:56:06 -0700 Subject: [PATCH 2/4] feat: refactor main workflow into test only --- .github/workflows/{main.yml => test.yml} | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) rename .github/workflows/{main.yml => test.yml} (67%) diff --git a/.github/workflows/main.yml b/.github/workflows/test.yml similarity index 67% rename from .github/workflows/main.yml rename to .github/workflows/test.yml index 423475a..1e847c3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/test.yml @@ -1,7 +1,7 @@ # This workflow will build a Java project with Gradle # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle -name: Java CI with Gradle +name: Test on: push: @@ -10,7 +10,7 @@ on: branches: [ main ] jobs: - build: + test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -29,15 +29,5 @@ jobs: run: | cd ./sample/ ./gradlew test - - name: Release - uses: cycjimmy/semantic-release-action@v3 - with: - extra_plugins: | - "@semantic-release/commit-analyzer" - "@semantic-release/release-notes-generator" - "@google/semantic-release-replace-plugin" - "@semantic-release/exec" - "@semantic-release/git" - "@semantic-release/github" env: GH_TOKEN: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }} From 654e168c69af46e3f0acf558ffbc04e57656c877 Mon Sep 17 00:00:00 2001 From: Bart Hazer Date: Tue, 28 May 2024 10:52:52 -0700 Subject: [PATCH 3/4] fix: update semantic-release plugin --- .github/workflows/release.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cc900a3..85342a5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,14 +46,11 @@ jobs: SONATYPE_USERNAME: ${{ secrets.SYNCED_SONATYPE_USERNAME }} GITHUB_PASSWORD: '${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}' - name: Semantic Release - uses: cycjimmy/semantic-release-action@v3 + uses: cycjimmy/semantic-release-action@v4 with: extra_plugins: | - "@semantic-release/commit-analyzer" - "@semantic-release/release-notes-generator" "@google/semantic-release-replace-plugin" "@semantic-release/exec" - "@semantic-release/git" "@semantic-release/github" env: GH_TOKEN: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }} From e2bd5551f263b18269354bd308f24c2fbd0f0197 Mon Sep 17 00:00:00 2001 From: Bart Hazer Date: Tue, 28 May 2024 10:59:34 -0700 Subject: [PATCH 4/4] feat: add test dependency to other workflows --- .github/workflows/dependabot.yml | 3 +++ .github/workflows/release.yml | 3 +++ .github/workflows/test.yml | 1 + 3 files changed, 7 insertions(+) diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml index 6b46ebb..a271121 100644 --- a/.github/workflows/dependabot.yml +++ b/.github/workflows/dependabot.yml @@ -19,7 +19,10 @@ permissions: contents: write jobs: + test: + uses: ./.github/workflows/test.yml dependabot: + needs: test runs-on: ubuntu-latest if: ${{ github.actor == 'dependabot[bot]' }} env: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 85342a5..9cedc57 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,10 @@ on: workflow_dispatch: jobs: + test: + uses: ./.github/workflows/test.yml release: + needs: test runs-on: ubuntu-latest steps: - name: Checkout diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1e847c3..92d5340 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,6 +8,7 @@ on: branches: [ main ] pull_request: branches: [ main ] + workflow_call: jobs: test: