-
Notifications
You must be signed in to change notification settings - Fork 8
84 lines (82 loc) · 3.2 KB
/
sbt-devops.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
72
73
74
75
76
77
78
79
80
81
82
83
84
# @see https://github.com/ohze/sbt-devops/blob/main/files/sbt-devops.yml
name: sbt-devops
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
outputs:
commitMsg: ${{ steps.commitMsg.outputs.msg }}
strategy:
matrix:
java: [ '8', '11', '17' ]
couchbase: [ '7.0.2', '5.0.1' ]
steps:
- uses: actions/checkout@v2
- id: commitMsg
run: echo "::set-output name=msg::$(git show -s --format=%s $GITHUB_SHA)"
- uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
- uses: coursier/cache-action@v6
- run: sbt devopsQA
- run: ./run-cb-test-container.sh
env:
CB_VERSION: ${{ matrix.couchbase }}
- run: sbt test
# https://www.scala-sbt.org/1.x/docs/GitHub-Actions-with-sbt.html#Caching
- run: |
rm -rf "$HOME/.ivy2/local" || true
find $HOME/Library/Caches/Coursier/v1 -name "ivydata-*.properties" -delete || true
find $HOME/.ivy2/cache -name "ivydata-*.properties" -delete || true
find $HOME/.cache/coursier/v1 -name "ivydata-*.properties" -delete || true
find $HOME/.sbt -name "*.lock" -delete || true
shell: bash
publish:
needs: build
if: |
success() &&
github.event_name == 'push' &&
(github.ref == 'refs/heads/master' ||
github.ref == 'refs/heads/10.x' ||
startsWith(github.ref, 'refs/tags/'))
runs-on: ubuntu-latest
outputs:
info: ${{ steps.info.outputs.info }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '8'
- run: sbt versionCheck ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
# optional
#CI_CLEAN: '; clean ; sonatypeBundleClean'
#CI_RELEASE: '+publishSigned'
#CI_SONATYPE_RELEASE: 'sonatypeBundleRelease'
#CI_SNAPSHOT_RELEASE: '+publish'
- id: info
run: echo "::set-output name=info::$(cat "$GITHUB_WORKSPACE/target/publish.info")"
notify:
needs: [build, publish]
if: always()
runs-on: ubuntu-latest
steps:
- uses: docker://ohze/devops-notify
env:
# You can use `DEVOPS_` | `SLACK_` prefix for `MATTERMOST_*` envs below
# ex SLACK_WEBHOOK_URL instead of MATTERMOST_WEBHOOK_URL
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
# optional. See https://developers.mattermost.com/integrate/incoming-webhooks/#parameters
#MATTERMOST_ICON: icon_url or icon_emoji
#MATTERMOST_CHANNEL: use default of the webhook if not set
#MATTERMOST_USERNAME: use default of the webhook if not set
#MATTERMOST_PRETEXT: Message shown above the CI status attachment, ex to mention some user. Default empty.
_DEVOPS_NEEDS: ${{ toJSON(needs) }}