Skip to content

Build

Build #2

Workflow file for this run

name: Build
on:
create:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
jobs:
docker_build_push:
env:
GIT_REF: ${{ github.ref }}
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Scala
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11
cache: sbt
- name: Show output of sed to build.sbt command for logs
run: |
VERS_TAG=$(echo $GIT_REF | sed 's/refs\/tags\/v//g')
VERS_TAG="\"$VERS_TAG"\"
sed "s/version := *.*/version := $VERS_TAG/" build.sbt
- name: Write Tag to Scala Build Version
run: |
VERS_TAG=$(echo $GIT_REF | sed 's/refs\/tags\/v//g')
VERS_TAG="\"$VERS_TAG"\"
sed -i "s/version := *.*/version := $VERS_TAG/" build.sbt
- name: Compile
run: sbt compile
- name: Run tests
run: sbt test
- name: Publish package
run: sbt publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}