Skip to content

Update build.yml

Update build.yml #59

Workflow file for this run

name: Build
on:
workflow_dispatch:
inputs: {}
push:
branches: [ "main" ]
tags: [ "v**" ]
pull_request:
branches: [ "main" ]
jobs:
build-scala:
runs-on: ubuntu-latest
steps:
- uses: 7mind/github-env@main
with:
java-version: 17
- name: Build and Test
env:
OPENSSL_IV: ${{ secrets.OPENSSL_IV }}
OPENSSL_KEY: ${{ secrets.OPENSSL_KEY }}
run: |
COMMAND="sbt +clean +test"
cd json-sick-scala
if [[ "$GITHUB_REF" == refs/heads/main || "$CI_BRANCH_TAG" =~ ^v.*$ ]] ; then
openssl aes-256-cbc -K ${OPENSSL_KEY} -iv ${OPENSSL_IV} -in ../secrets.tar.enc -out secrets.tar -d
tar xvf secrets.tar
COMMAND="$COMMAND +publishSigned"
if [[ "$CI_BRANCH_TAG" =~ ^v.*$ ]] ; then
COMMAND="$COMMAND sonatypeBundleRelease"
fi
fi
echo $COMMAND
eval $COMMAND
build-cs:
runs-on: ubuntu-latest
steps:
- uses: 7mind/github-env@main
with:
java-enable: false
nuget-enable: true
- name: Build and Test
env:
NUGET_TOKEN: ${{ secrets.TOKEN_NUGET }}
run: |
cd json-sick-csharp
# dotnet clean -c Release
if [[ "$CI_BRANCH_TAG" =~ ^v.*$ ]] ; then
dotnet build -c Release
else
dotnet build -c Release --version-suffix "alpha.${CI_BUILD_UNIQ_SUFFIX}"
fi
for TRG in $(find . -name '*.nupkg' -type f -print)
do
dotnet nuget push $TRG -k ${TOKEN_NUGET} --source https://api.nuget.org/v3/index.json || exit 1
done