Skip to content

Commit

Permalink
add publishing configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
jillesvangurp committed Jan 2, 2024
1 parent 7a5a633 commit f0a7ee9
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
11 changes: 11 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ plugins {
kotlin("plugin.serialization")
id("org.jetbrains.dokka")
id("com.avast.gradle.docker-compose")
id("maven-publish")
}

repositories {
Expand Down Expand Up @@ -51,6 +52,16 @@ configure<ComposeExtension> {
setProjectName("pg-docstore")
}

configure<PublishingExtension> {
repositories {
maven {
// GOOGLE_APPLICATION_CREDENTIALS env var must be set for this to work
// public repository is at https://maven.tryformation.com/releases
url = uri("gcs://mvn-public-tryformation/releases")
name = "FormationPublic"
}
}
}

tasks.withType<Test> {
failFast = false
Expand Down
23 changes: 23 additions & 0 deletions publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#! /usr/bin/env bash
set -e

die () {
echo >&2 "$@"
exit 1
}

[ "$#" -eq 1 ] || die "1 argument required, $# provided"
echo $1 | grep -E -q '^[0-9]+\.[0-9]+(\.[0-9]+).*?$' || die "Semantic Version argument required, $1 provided"

[[ -z $(git status -s) ]] || die "git status is not clean"

export TAG=$1

gradle -Pversion="$TAG" publish

echo "tagging"
git tag "$TAG"

echo "publishing $TAG"

git push --tags

0 comments on commit f0a7ee9

Please sign in to comment.