Skip to content

Commit 81ec2f1

Browse files
committed
Update publication config
* Allows publication to a custom maven repo, as we do in CI tasks * Adds `SKIP_TESTS` (defaults to `false`) param for quicker testing of CI build task with `fly execute`
1 parent f9a6b9a commit 81ec2f1

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,11 @@ configure(publishedProjects) {
232232
apply plugin: 'maven-publish'
233233

234234
publishing {
235+
repositories {
236+
maven {
237+
url = project.properties.getOrDefault('publicationRepository', "${System.getenv('HOME')}/.m2/repository")
238+
}
239+
}
235240
publications {
236241
mavenJava(MavenPublication) {
237242
suppressAllPomMetadataWarnings()

ci/scripts/build-project.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,19 @@
33
set -euo pipefail
44

55
readonly ONLY_SHOW_STANDARD_STREAMS_ON_TEST_FAILURE="${ONLY_SHOW_STANDARD_STREAMS_ON_TEST_FAILURE:-true}"
6+
readonly SKIP_TESTS="${SKIP_TESTS:-false}"
67

78
# shellcheck source=common.sh
89
source "$(dirname "$0")/common.sh"
910
repository=$(pwd)/distribution-repository
11+
if [ "$SKIP_TESTS" == "true" ]; then
12+
build_task=assemble
13+
else
14+
build_task=build
15+
fi
1016

1117
pushd git-repo >/dev/null
12-
./gradlew --parallel clean build install \
18+
./gradlew --parallel clean "$build_task" publish \
1319
-PonlyShowStandardStreamsOnTestFailure="${ONLY_SHOW_STANDARD_STREAMS_ON_TEST_FAILURE}" \
14-
-Dmaven.repo.local="${repository}"
20+
-PpublicationRepository="${repository}"
1521
popd >/dev/null

ci/scripts/stage.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ git commit -m "Release v$stageVersion"
3737
git tag -a "v$stageVersion" -m "Release v$stageVersion"
3838
echo
3939

40-
./gradlew --no-daemon clean install -Dmaven.repo.local="${repository}"
40+
./gradlew clean publish -PpublicationRepository="${repository}"
4141
echo
4242

4343
echo "Setting next development version (v$nextVersion)"

ci/tasks/build-project.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ run:
1616
path: git-repo/ci/scripts/build-project.sh
1717
params:
1818
ONLY_SHOW_STANDARD_STREAMS_ON_TEST_FAILURE: true
19+
SKIP_TESTS: false

0 commit comments

Comments
 (0)