From c2245867b7ce20c95194168e052bbf1d589bf3ed Mon Sep 17 00:00:00 2001 From: zero88 Date: Tue, 19 Mar 2024 19:49:00 +0700 Subject: [PATCH 1/2] chore(build): use shared-ghactions in `build` GHA job --- .github/actions/gha-build/action.yml | 43 ---------------------------- .github/workflows/jooqx.yml | 24 ++++++---------- .github/workflows/jpa.yml | 23 +++++---------- .github/workflows/rsql.yml | 23 +++++---------- 4 files changed, 22 insertions(+), 91 deletions(-) delete mode 100644 .github/actions/gha-build/action.yml diff --git a/.github/actions/gha-build/action.yml b/.github/actions/gha-build/action.yml deleted file mode 100644 index 39b48f61..00000000 --- a/.github/actions/gha-build/action.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: build -description: 'Build project' -inputs: - profile: - description: 'Build profile' - required: true - version: - description: 'Project version' - required: true - semanticVersion: - description: 'Project semantic version' - required: true - hashVersion: - description: 'Project hash commit' - required: true - javaDist: - description: 'Java distribution' - required: true - default: 'temurin' - javaVersion: - description: 'Java version' - required: true - default: '11' - -runs: - using: 'composite' - steps: - - uses: actions/setup-java@v4 - with: - distribution: ${{ inputs.javaDist }} - java-version: ${{ inputs.javaVersion }} - cache: 'gradle' - - - name: Build - shell: bash - run: | - ./gradlew clean build -x test \ - -Pprofile=${{ inputs.profile }} \ - -Pversion=${{ inputs.version }} \ - -PsemanticVersion=${{ inputs.semanticVersion }} \ - -PbuildBy="GitHub-Action" \ - -PbuildHash=${{ inputs.hashVersion }} \ - --no-daemon diff --git a/.github/workflows/jooqx.yml b/.github/workflows/jooqx.yml index e466eba0..bfc1dd8e 100644 --- a/.github/workflows/jooqx.yml +++ b/.github/workflows/jooqx.yml @@ -38,28 +38,20 @@ jobs: gpgPassphrase: ${{ secrets.CI_GPG_PASSPHARSE }} build: + uses: zero88/shared-ghactions/.github/workflows/gradle-build.yml@main needs: context if: needs.context.outputs.shouldBuild == 'true' strategy: matrix: java: [ '8', '11', '17' ] os: [ 'ubuntu-latest', 'windows-latest' ] - name: Build Java ${{ matrix.java }} (${{ matrix.os }}) - runs-on: ${{ matrix.os }} - env: - PROFILE: 'ciBuild' - steps: - - uses: actions/checkout@v4 - - - name: Build - uses: ./.github/actions/gha-build - with: - profile: ${{ env.PROFILE }} - version: ${{ needs.context.outputs.version }} - semanticVersion: ${{ needs.context.outputs.semanticVersion }} - hashVersion: ${{ needs.context.outputs.commitId }} - javaDist: ${{ env.JAVA_DIST }} - javaVersion: ${{ matrix.java }} + name: Build & Test Java ${{ matrix.java }} (${{ matrix.os }}) + with: + profile: 'jooqx' + version: ${{ needs.context.outputs.version }} + semanticVersion: ${{ needs.context.outputs.semanticVersion }} + hashVersion: ${{ needs.context.outputs.commitId }} + javaVersion: ${{ matrix.java }} analysis: needs: context diff --git a/.github/workflows/jpa.yml b/.github/workflows/jpa.yml index 2ef033ed..fb7e152f 100644 --- a/.github/workflows/jpa.yml +++ b/.github/workflows/jpa.yml @@ -37,6 +37,7 @@ jobs: gpgPassphrase: ${{ secrets.CI_GPG_PASSPHARSE }} build: + uses: zero88/shared-ghactions/.github/workflows/gradle-build.yml@main needs: context if: needs.context.outputs.shouldBuild == 'true' strategy: @@ -44,22 +45,12 @@ jobs: java: [ '8', '11', '17' ] os: [ 'ubuntu-latest', 'windows-latest' ] name: Build & Test Java ${{ matrix.java }} (${{ matrix.os }}) - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - - name: Build - uses: ./.github/actions/gha-build - with: - profile: ${{ env.PROFILE }} - version: ${{ needs.context.outputs.version }} - semanticVersion: ${{ needs.context.outputs.semanticVersion }} - hashVersion: ${{ needs.context.outputs.commitId }} - javaVersion: ${{ matrix.java }} - - - name: Test - shell: bash - run: ./gradlew test -Pprofile=${{ env.PROFILE }} + with: + profile: 'jpa' + version: ${{ needs.context.outputs.version }} + semanticVersion: ${{ needs.context.outputs.semanticVersion }} + hashVersion: ${{ needs.context.outputs.commitId }} + javaVersion: ${{ matrix.java }} publish: needs: [ context, build ] diff --git a/.github/workflows/rsql.yml b/.github/workflows/rsql.yml index 74b5b899..d63c2434 100644 --- a/.github/workflows/rsql.yml +++ b/.github/workflows/rsql.yml @@ -36,6 +36,7 @@ jobs: gpgPassphrase: ${{ secrets.CI_GPG_PASSPHARSE }} build: + uses: zero88/shared-ghactions/.github/workflows/gradle-build.yml@main needs: context if: needs.context.outputs.shouldBuild == 'true' strategy: @@ -43,22 +44,12 @@ jobs: java: [ '8', '11', '17' ] os: [ 'ubuntu-latest', 'windows-latest' ] name: Build & Test Java ${{ matrix.java }} (${{ matrix.os }}) - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - - name: Build - uses: ./.github/actions/gha-build - with: - profile: ${{ env.PROFILE }} - version: ${{ needs.context.outputs.version }} - semanticVersion: ${{ needs.context.outputs.semanticVersion }} - hashVersion: ${{ needs.context.outputs.commitId }} - javaVersion: ${{ matrix.java }} - - - name: Test - shell: bash - run: ./gradlew test -Pprofile=${{ env.PROFILE }} + with: + profile: 'rsql' + version: ${{ needs.context.outputs.version }} + semanticVersion: ${{ needs.context.outputs.semanticVersion }} + hashVersion: ${{ needs.context.outputs.commitId }} + javaVersion: ${{ matrix.java }} docs: uses: zero88/shared-ghactions/.github/workflows/antora-docs.yml@main From 10e6e160c4e047fca01dcbfa292f50f248b6cd3d Mon Sep 17 00:00:00 2001 From: zero88 Date: Tue, 19 Mar 2024 20:09:15 +0700 Subject: [PATCH 2/2] chore(build): remove some default args in GHA webdocs --- .github/workflows/jooqx.yml | 3 --- .github/workflows/rsql.yml | 3 --- 2 files changed, 6 deletions(-) diff --git a/.github/workflows/jooqx.yml b/.github/workflows/jooqx.yml index bfc1dd8e..95174f34 100644 --- a/.github/workflows/jooqx.yml +++ b/.github/workflows/jooqx.yml @@ -175,9 +175,6 @@ jobs: needs: [ context, docs ] if: needs.context.outputs.shouldPublish == 'true' || needs.context.outputs.isRelease == 'true' with: - webdocsRepo: 'zero88/webdocs' - webdocsRef: 'main' - webdocsWorkflow: 'webdocs.yml' docCommitMsg: ${{ needs.context.outputs.docCommitMsg }} secrets: githubToken: ${{ secrets.OSS_GITHUB_TOKEN }} diff --git a/.github/workflows/rsql.yml b/.github/workflows/rsql.yml index d63c2434..1abd41a6 100644 --- a/.github/workflows/rsql.yml +++ b/.github/workflows/rsql.yml @@ -78,9 +78,6 @@ jobs: needs: [ context, docs ] if: needs.context.outputs.shouldPublish == 'true' || needs.context.outputs.isRelease == 'true' with: - webdocsRepo: 'zero88/webdocs' - webdocsRef: 'main' - webdocsWorkflow: 'webdocs.yml' docCommitMsg: ${{ needs.context.outputs.docCommitMsg }} secrets: githubToken: ${{ secrets.OSS_GITHUB_TOKEN }}