Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ on:
workflow_call:
inputs:
verify_sbt_command:
description: 'sbt command for verifying the build before publishing'
description: >-
sbt command for verifying the build before publishing. Defaults to
`cleanFull; +check; +all testFull package` on sbt 2 and `+clean; +check; +all test package`
on sbt 1, detected from project/build.properties.
type: string
default: '+clean; +check; +all test package'
default: ''
publish_sbt_command:
description: 'sbt command for publishing artefacts to the Evo JFrog Artifactory'
type: string
Expand Down Expand Up @@ -51,8 +54,25 @@ jobs:
echo "user=github-publish" >> ${{ env.SBT_CREDENTIALS }}
echo "password=${{secrets.JFROG_ACCESS_TOKEN}}" >> ${{ env.SBT_CREDENTIALS }}

- name: resolve verify command
id: verify-command
env:
VERIFY_SBT_COMMAND: ${{ inputs.verify_sbt_command }}
run: |
if [[ -n "$VERIFY_SBT_COMMAND" ]]; then
echo "command=$VERIFY_SBT_COMMAND" >> "$GITHUB_OUTPUT"
elif grep -qE '^sbt\.version\s*=\s*2\.' project/build.properties; then
# sbt 2 redefined `test` to run only tests that failed or never ran,
# and its `clean` doesn't remove all generated classes
echo "command=cleanFull; +check; +all testFull package" >> "$GITHUB_OUTPUT"
else
echo "command=+clean; +check; +all test package" >> "$GITHUB_OUTPUT"
fi

- name: verify the build
run: sbt "${{ inputs.verify_sbt_command }}"
env:
VERIFY_SBT_COMMAND: ${{ steps.verify-command.outputs.command }}
run: sbt "$VERIFY_SBT_COMMAND"

- name: publish on JFrog Artifactory
run: sbt "${{ inputs.publish_sbt_command }}"
Expand Down
Loading