-
Notifications
You must be signed in to change notification settings - Fork 36
71 lines (67 loc) · 2.39 KB
/
ci.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: CI
env:
JAVA_OPTS: "-Dfile.encoding=UTF-8 -Xms1024M -Xmx3072M -Xss4M"
on:
push:
branches: '**'
tags: [ "v[0-9]+*" ]
pull_request:
# avoid duplicate checks (push & PR) further in the review process
types: [opened]
jobs:
test:
name: Run tests
runs-on: ubuntu-22.04 # https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md
strategy:
fail-fast: false
matrix:
scala: [ 2.13.14 ]
command: [ udash-jvm/test, udash-js/test, guide-selenium/test ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
cache: sbt
- uses: actions/setup-node@v4
with:
cache: npm
- name: Install npm dependencies
run: npm install
- name: Run tests
run: sbt ++${{ matrix.scala }} ${{ matrix.command }}
publish:
name: Publish to Sonatype
# only run on tag push
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/v'))
needs: [ test ]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
cache: sbt
- name: Get version
id: get_tag_name
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Import GPG key
env:
#exported via `gpg -a --export-secret-keys <key> | cat -e | sed 's/\$/\\n/g' | xclip -selection clipboard` and added to org secrets
SONATYPE_GPG: ${{ secrets.SONATYPE_GPG }}
run: echo -e $SONATYPE_GPG | gpg --import -
- name: Publish artifacts
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
run: sbt 'set ThisBuild/version := "${{ steps.get_tag_name.outputs.VERSION }}"' +publishSigned
- name: Release Sonatype bundle
#https://github.com/xerial/sbt-sonatype#publishing-your-artifact
if: ${{ !endsWith(steps.get_tag_name.outputs.VERSION, 'SNAPSHOT') }}
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
run: sbt 'set ThisBuild/version := "${{ steps.get_tag_name.outputs.VERSION }}"' sonatypeBundleRelease