Skip to content

Commit

Permalink
[release] testing
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Di Tommaso <[email protected]>
  • Loading branch information
pditommaso committed Aug 19, 2023
1 parent 5ae77a7 commit 13db703
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ jobs:
- name: Release
if: "contains(github.event.head_commit.message, '[release]')"
run: |
bash publish.sh lib-mail
bash publish.sh wave-api
bash publish.sh wave-utils
bash -x publish.sh lib-mail
bash -x publish.sh wave-api
bash -x publish.sh wave-utils
env:
GRADLE_OPTS: '-Dorg.gradle.daemon=false'
AWS_ACCESS_KEY_ID: ${{secrets.TOWER_CI_AWS_ACCESS}}
Expand Down
19 changes: 12 additions & 7 deletions publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@ BASE_PATH=$(basename $BASE_URL)
KEY=$BASE_PATH/io/seqera/$NAME/$VERSION/$NAME-$VERSION.pom

echo "Publishing '$NAME-$VERSION' to $BUCKET/$KEY"
aws s3api head-object --bucket $BUCKET --key $KEY &> /dev/null

# Check the exit status of the command
if [ $? -eq 0 ]; then
ret=$(aws s3api head-object --bucket $BUCKET --key $KEY 2>&1) && {
# already exists => just a message
echo "NOTE: Library $NAME-$VERSION already exist - skipping publishing"
else
./gradlew $NAME:publishMavenPublicationToSeqeraRepositoryRepository
fi
} || {
if [[ $ret == *"Not Found"* ]]; then
# the lib does not exist => punlish it
./gradlew $NAME:publishMavenPublicationToSeqeraRepositoryRepository
else
# print the error message
echo $ret >&2
fi
}

0 comments on commit 13db703

Please sign in to comment.