-
Notifications
You must be signed in to change notification settings - Fork 83
120 lines (115 loc) · 3.86 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: CI
on:
push:
branches: ["**"]
tags: ["v*"]
pull_request:
branches: ["master"]
permissions:
contents: read
jobs:
ci:
name: Build and test
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
cache: sbt
- name: Run tests and coverage
run: |-
cp .jvmopts-ci .jvmopts
sbt coverage test coverageReport && bash <(curl -s https://codecov.io/bash)
- name: Prepare draft release notes
# Run this step only in the original repo and for pushes to the master branch or for tags starting with 'v'
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')) && ! github.event.repository.fork }}
continue-on-error: true
uses: release-drafter/release-drafter@v6
with:
config-name: release-drafter.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-sonatype:
permissions:
contents: write
pull-requests: write
name: Publish to Sonatype
# Publish to Sonatype only from the original repo and for the tags starting with 'v'
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && ! github.event.repository.fork }}
needs: [ci]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
cache: sbt
- name: Publish to Sonatype
run: sbt ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
publish-azure:
permissions:
contents: write
pull-requests: write
name: Publish to Azure
# Publish to Azure all the commits for all the branches from the original repo except for tags.
if: ${{ github.event_name == 'push' && ! startsWith(github.ref, 'refs/tags/') && ! github.event.repository.fork }}
needs: [ci]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
cache: sbt
- name: Publish to Azure
run: sbt "clean; +aetherDeploy; project interaction-example-make-payment-and-ship-items; +aetherDeploy; project interaction-example-reserve-items; +aetherDeploy; project bakery-client-example; +aetherDeploy; project bakery-kafka-listener-example; +aetherDeploy"
env:
AZURE_FEEDUSER: ${{ secrets.AZURE_FEEDUSER }}
AZURE_FEEDPASSWORD: ${{ secrets.AZURE_FEEDPASSWORD }}
AZURE_FEEDURL: ${{ secrets.AZURE_FEEDURL }}
dependency-submission:
name: Submit dependency graph
continue-on-error: true
needs: [ci]
# Submit dependency graph only for the master branch commits
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
cache: sbt
- name: Submit dependency graph
uses: scalacenter/sbt-dependency-submission@v2