Skip to content

Commit

Permalink
Update GHA - fix inputs, outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
snf2ye committed Aug 3, 2023
1 parent 96d1b03 commit f8f2edd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,14 @@ jobs:
if: success() && github.ref == 'refs/heads/main'

publish-library:
needs: [ build, unit-tests-and-sonarqube, source-clear, tag ]
needs: [ tag ]
uses: ./.github/workflows/publish.yml
if: success() && github.ref == 'refs/heads/main'
with:
tag: ${{ needs.tag.outputs.tag }}

release-cli:
needs: [ build, unit-tests-and-sonarqube, source-clear, tag, publish-library ]
needs: [ tag ]
uses: ./.github/workflows/release-cli.yml
if: success() && github.ref == 'refs/heads/main'
with:
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: Publish Library to Artifactory
on: workflow_call
on:
workflow_call:
inputs:
tag:
required: true
type: string

env:
SERVICE_NAME: ${{ github.event.repository.name }}
Expand All @@ -12,21 +17,18 @@ jobs:
contents: 'read'
id-token: 'write'
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.tag.outputs.tag }}
steps:
- uses: actions/checkout@v3
- name: Checkout Repo
uses: actions/checkout@v3
with:
ref: ${{ inputs.tag }}
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

- name: Parse tag
id: tag
run: echo "tag=$(git describe --tags)" >> $GITHUB_OUTPUT

- name: Publish Library Artifactory
run: ./gradlew --build-cache :library:artifactoryPublish
env:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v3
with:
ref: ${{ needs.tag-job.outputs.tag }}
ref: ${{ inputs.tag }}
- name: Set up JDK
uses: actions/setup-java@v3
with:
Expand All @@ -25,9 +25,9 @@ jobs:
./gradlew --build-cache :cli:jar
./gradlew --build-cache :cli:assembleDist
- name: Create tagged release with CLI jar
run: gh release create ${{ needs.tag-job.outputs.tag }} 'cli/build/libs/java-pfb-cli-${{ needs.tag-job.outputs.tag }}.jar' 'cli/build/distributions/cli-${{ needs.tag-job.outputs.tag }}.zip' --generate-notes --verify-tag
run: gh release create ${{ inputs.tag }} 'cli/build/libs/java-pfb-cli-${{ inputs.tag }}.jar' 'cli/build/distributions/cli-${{ inputs.tag }}.zip' --generate-notes --verify-tag
env:
GH_TOKEN: ${{ github.token }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Notify slack on failure
uses: broadinstitute/action-slack@v3.8.0
if: failure()
Expand Down

0 comments on commit f8f2edd

Please sign in to comment.