Skip to content

Commit

Permalink
wip: nixify
Browse files Browse the repository at this point in the history
  • Loading branch information
pshirshov committed Oct 26, 2024
1 parent 8df06c5 commit f166433
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion devops/.env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export SCALA212=$(cat project/Deps.sc | grep 'val scala212 ' | sed -r 's/.*\"(.
export SCALA213=$(cat project/Deps.sc | grep 'val scala213 ' | sed -r 's/.*\"(.*)\".**/\1/')
export SCALA3=$(cat project/Deps.sc | grep 'val scala300 ' | sed -r 's/.*\"(.*)\".**/\1/')

[[ -z "$SCALA_VERSION" ]] && exit 1
[[ -z "$SCALA_VERSION" ]] && echo "Missing SCALA_VERSION" && exit 1

case $SCALA_VERSION in
2.12) SCALA_VERSION="$SCALA212" ;;
Expand Down
7 changes: 7 additions & 0 deletions devops/.validate-publishing.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

set -e
set -x

[[ "$CI_PULL_REQUEST" != "false" ]] && echo "Publishing not allowed on P/Rs" && exit 0
[[ ! ("$CI_BRANCH" == "develop" || "$CI_BRANCH_TAG" =~ ^v.*$ ) ]] && echo "Publishing not allowed (CI_BRANCH=$CI_BRANCH, CI_BRANCH_TAG=$CI_BRANCH_TAG)" && exit 0
8 changes: 4 additions & 4 deletions devops/publish-alien.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ set -x
source ./devops/.env-basic.sh
printenv

[[ "$CI_PULL_REQUEST" != "false" ]] && exit 0
[[ -z "$TOKEN_NUGET" ]] && exit 0
[[ -z "$TOKEN_NPM" ]] && exit 0
[[ ! ("$CI_BRANCH" == "develop" || "$CI_BRANCH_TAG" =~ ^v.*$ ) ]] && exit 0
source ./devops/.validate-publishing.sh

[[ -z "$TOKEN_NUGET" ]] && echo "Missing TOKEN_NUGET" && exit 0
[[ -z "$TOKEN_NPM" ]] && echo "Missing TOKEN_NPM" && exit 0


echo "PUBLISH IDL RUNTIMES..."
Expand Down
7 changes: 4 additions & 3 deletions devops/publish-scala.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ set -e
set -x

source ./devops/.env.sh
printenv

[[ "$CI_PULL_REQUEST" != "false" ]] && exit 0
[[ ! ("$CI_BRANCH" == "develop" || "$CI_BRANCH_TAG" =~ ^v.*$ ) ]] && exit 0
[[ -f "$SONATYPE_SECRET"]] && exit 0
source ./devops/.validate-publishing.sh

[[ -f "$SONATYPE_SECRET" ]] && echo "Missing SONATYPE_SECRET=$SONATYPE_SECRET is not a file" && exit 0


echo "PUBLISH SCALA LIBRARIES..."
Expand Down

0 comments on commit f166433

Please sign in to comment.