Skip to content

Commit

Permalink
[GHA] Some small CI optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
zero88 committed Apr 3, 2022
1 parent facd5ca commit 0aab871
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/jooqx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ jobs:

release:
runs-on: ubuntu-latest
needs: [ context, build, analysis, publish ]
needs: [ context, publish, docs ]
if: needs.context.outputs.isRelease == 'true'
steps:
- name: Create GitHub Release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/jpa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:

release:
runs-on: ubuntu-latest
needs: [ context, build, publish ]
needs: [ context, publish ]
if: needs.context.outputs.isRelease == 'true'
steps:
- name: Create GitHub Release
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/rsql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ jobs:
run: ./gradlew test -Pprofile=${{ env.PROFILE }}

docs:
runs-on: ubuntu-latest
needs: [ context, build ]
if: needs.context.outputs.shouldPublish == 'true' || needs.context.outputs.isRelease == 'true'
runs-on: ubuntu-latest
env:
REPO: zero88/jooqx
REF: main
Expand Down Expand Up @@ -104,9 +104,9 @@ jobs:
gpgPassphrase: ${{ secrets.CI_GPG_PASSPHARSE }}

release:
runs-on: ubuntu-latest
needs: [ context, build, publish ]
needs: [ context, publish, docs ]
if: needs.context.outputs.isRelease == 'true'
runs-on: ubuntu-latest
steps:
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
Expand Down
25 changes: 18 additions & 7 deletions .github/workflows/subwf-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ on:
required: true

jobs:
publish:
name: Publish to registry
publish-snapshot:
name: Publish to Nexus Snapshot
if: inputs.isRelease != 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.4.0
Expand All @@ -60,8 +61,7 @@ jobs:
java-version: ${{ inputs.javaVersion }}
cache: 'gradle'

- name: Publish Sonatype OSSRH Snapshot
if: inputs.isRelease != 'true'
- name: Publish
shell: bash
run: |
args=( -Pprofile=${{ inputs.profile }} \
Expand All @@ -71,17 +71,28 @@ jobs:
-Pnexus.password=${{ secrets.ossrhToken }} )
./gradlew publish "${args[@]}"
publish-release:
name: Publish to Nexus Release
if: inputs.isRelease == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.4.0

- uses: actions/setup-java@v2
with:
distribution: ${{ inputs.javaDist }}
java-version: ${{ inputs.javaVersion }}
cache: 'gradle'

- name: Import GPG key
id: import_gpg
if: inputs.isRelease == 'true'
uses: crazy-max/ghaction-import-gpg@v3
with:
git-user-signingkey: true
gpg-private-key: ${{ secrets.gpgKey }}
passphrase: ${{ secrets.gpgPassphrase }}

- name: Publish Sonatype OSSRH
if: inputs.isRelease == 'true'
- name: Publish
shell: bash
run: |
args=( -Pprofile=${{ inputs.profile }} \
Expand Down

0 comments on commit 0aab871

Please sign in to comment.