6
6
branches : ['**']
7
7
tags : [v*]
8
8
jobs :
9
- ci :
9
+ build :
10
+ uses : softwaremill/github-actions-workflows/.github/workflows/build-scala.yml@main
10
11
# run on 1) push, 2) external PRs, 3) softwaremill-ci PRs
11
12
# do not run on internal, non-steward PRs since those will be run by push to branch
12
13
if : |
13
14
github.event_name == 'push' ||
14
15
github.event.pull_request.head.repo.full_name != github.repository ||
15
16
github.event.pull_request.user.login == 'softwaremill-ci'
16
- runs-on : ubuntu-22.04
17
- steps :
18
- - name : Checkout
19
- uses : actions/checkout@v4
20
- - name : Set up JDK
21
- uses : actions/setup-java@v4
22
- with :
23
- distribution : ' zulu'
24
- java-version : ' 21'
25
- cache : ' sbt'
26
- - name : Compile
27
- run : sbt -v compile
28
- - name : Compile documentation
29
- run : sbt -v compileDocs
30
- - name : Test
31
- run : sbt -v test
32
- - uses : actions/upload-artifact@v4 # upload test results
33
- if : success() || failure() # run this step even if previous step failed
34
- with :
35
- name : ' tests-results'
36
- path : ' **/test-reports/TEST*.xml'
17
+ with :
18
+ java-version : ' 21'
19
+ compile-documentation : true
37
20
38
21
publish :
39
- name : Publish release
40
- needs : [ci ]
22
+ uses : softwaremill/github-actions-workflows/.github/workflows/publish- release.yml@main
23
+ needs : [build ]
41
24
if : github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
42
- runs-on : ubuntu-22.04
43
- env :
44
- JAVA_OPTS : -Xmx4G
45
- steps :
46
- - name : Checkout
47
- uses : actions/checkout@v4
48
- - name : Set up JDK
49
- uses : actions/setup-java@v4
50
- with :
51
- distribution : ' zulu'
52
- java-version : ' 21'
53
- cache : ' sbt'
54
- - name : Compile
55
- run : sbt compile
56
- - name : Publish artifacts
57
- run : sbt ci-release
58
- env :
59
- PGP_PASSPHRASE : ${{ secrets.PGP_PASSPHRASE }}
60
- PGP_SECRET : ${{ secrets.PGP_SECRET }}
61
- SONATYPE_USERNAME : ${{ secrets.SONATYPE_USERNAME }}
62
- SONATYPE_PASSWORD : ${{ secrets.SONATYPE_PASSWORD }}
63
- - name : Extract version from commit message
64
- run : |
65
- version=${GITHUB_REF/refs\/tags\/v/}
66
- echo "VERSION=$version" >> $GITHUB_ENV
67
- env :
68
- COMMIT_MSG : ${{ github.event.head_commit.message }}
69
- - name : Publish release notes
70
- uses : release-drafter/release-drafter@v5
71
- with :
72
- config-name : release-drafter.yml
73
- publish : true
74
- name : " v${{ env.VERSION }}"
75
- tag : " v${{ env.VERSION }}"
76
- version : " v${{ env.VERSION }}"
77
- env :
78
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
25
+ secrets : inherit
26
+ with :
27
+ java-version : ' 21'
28
+ java-opts : " -Xmx4G"
79
29
80
- # `automerge` label is attached iff there is exactly one file changed by steward and this file belongs to a
81
- # whitelist specified by `labeler.yml`
82
30
label :
83
- name : Attach automerge label
84
31
# only for PRs by softwaremill-ci
85
32
if : github.event.pull_request.user.login == 'softwaremill-ci'
86
- runs-on : ubuntu-22.04
87
- steps :
88
- - uses : actions/checkout@v4
89
- with :
90
- fetch-depth : 2
91
- # count number of files changed
92
- - name : Count number of files changed
93
- id : count-changed-files
94
- run : |
95
- N=$(git diff --name-only -r HEAD^1 HEAD | wc -w)
96
- echo "changed_files_num=$N" >> $GITHUB_OUTPUT
97
- - name : Launch labeler
98
- # skip if more than one file changed
99
- if : steps.count-changed-files.outputs.changed_files_num == 1
100
- uses : srvaroa/labeler@master
101
- env :
102
- GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
33
+ uses : softwaremill/github-actions-workflows/.github/workflows/label.yml@main
103
34
104
35
auto-merge :
105
- name : Auto merge
106
36
# only for PRs by softwaremill-ci
107
37
if : github.event.pull_request.user.login == 'softwaremill-ci'
108
- needs : [ ci, label ]
109
- runs-on : ubuntu-22.04
110
- steps :
111
- - id : automerge
112
- name : automerge
113
- uses : " pascalgn/automerge-action@v0.15.6"
114
- env :
115
- GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
116
- MERGE_METHOD : " squash"
38
+ needs : [ build, label ]
39
+ uses : softwaremill/github-actions-workflows/.github/workflows/auto-merge.yml@main
0 commit comments