-
-
Notifications
You must be signed in to change notification settings - Fork 7
110 lines (105 loc) · 3.24 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
name: ZIO Selenium Continuous Integration
on:
pull_request:
push:
branches: ["master"]
tags: ["v*.*.*"]
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout current branch
uses: actions/[email protected]
- name: Setup Scala and Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Cache scala dependencies
uses: coursier/cache-action@v6
- name: Check formatting and linting
run: sbt "-Dfatal-warnings=true" check
test:
runs-on: ubuntu-20.04
timeout-minutes: 60
steps:
- name: Checkout current branch
uses: actions/[email protected]
- name: Setup Scala and Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Cache scala dependencies
uses: coursier/cache-action@v6
- name: Run tests
run: sbt test
- name: Publish coverage to codecov
uses: codecov/codecov-action@v2
publish:
runs-on: ubuntu-20.04
timeout-minutes: 60
needs: [check, test]
if: github.event_name != 'pull_request'
steps:
- name: Checkout current branch
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Setup Scala and Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Publish the library
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 }}
CI_RELEASE: publishSigned
CI_SNAPSHOT_RELEASE: publish
release:
runs-on: ubuntu-20.04
timeout-minutes: 60
needs: [publish]
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout current branch
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Set the release version
shell: bash
run: echo "RELEASE_VERSION=${GITHUB_REF:11}" >> $GITHUB_ENV
- name: Create changes
shell: bash
run: touch CHANGES.md
- name: Generate a changelog
uses: orhun/git-cliff-action@v1
id: git-cliff
with:
config: cliff.toml
args: -vv --latest --strip header
env:
OUTPUT: CHANGES.md
- name: Set the release body
id: release
shell: bash
run: |
r=$(cat ${{ steps.git-cliff.outputs.changelog }})
r="${r//'%'/'%25'}" # Multiline escape sequences for %
r="${r//$'\n'/'%0A'}" # Multiline escape sequences for '\n'
r="${r//$'\r'/'%0D'}" # Multiline escape sequences for '\r'
echo "::set-output name=RELEASE_BODY::$r"
- name: Create the release on github
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release v${{ env.RELEASE_VERSION }}
body: ${{ steps.release.outputs.RELEASE_BODY }}
draft: false
prerelease: false