forked from ONSdigital/csvw-check
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (40 loc) · 1.13 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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 }}