1# see https://coderwall.com/p/9b_lfq
2
3set -eux
4
5if [ "$GITHUB_REPOSITORY" == "google/dagger" ] && \
6   [ "$GITHUB_EVENT_NAME" == "push" ] && \
7   [ "$GITHUB_REF" == "refs/heads/master" ]; then
8  echo -e "Publishing maven snapshot...\n"
9
10  bash $(dirname $0)/deploy-dagger.sh \
11    "deploy:deploy-file" \
12    "HEAD-SNAPSHOT" \
13    "-DrepositoryId=sonatype-nexus-snapshots" \
14    "-Durl=https://oss.sonatype.org/content/repositories/snapshots" \
15    "--settings=$(dirname $0)/settings.xml"
16
17  bash $(dirname $0)/deploy-hilt.sh \
18    "deploy:deploy-file" \
19    "HEAD-SNAPSHOT" \
20    "-DrepositoryId=sonatype-nexus-snapshots" \
21    "-Durl=https://oss.sonatype.org/content/repositories/snapshots" \
22    "--settings=$(dirname $0)/settings.xml"
23
24  echo -e "Published maven snapshot"
25else
26  echo -e "Not publishing snapshot for branch=${$GITHUB_REF}"
27fi
28