Skip to content

Commit ba0962a

Browse files
committed
rework build
1 parent 51a88e4 commit ba0962a

File tree

69 files changed

+562
-417
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+562
-417
lines changed

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
reviewers:
8+
- "Odomontois"
9+
- "catostrophe"
10+
labels:
11+
- "dependency-update"

.github/mergify.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
pull_request_rules:
2+
- name: request reviews and label scala-steward's PRs
3+
conditions:
4+
- author=scala-steward
5+
actions:
6+
request_reviews:
7+
users: [Odomontois, catostrophe]
8+
label:
9+
add: [dependency-update]
10+
11+
- name: automatically merge scala-steward's PRs affecting project plugins
12+
conditions:
13+
- author=scala-steward
14+
- status-success~=Test \(ubuntu-latest, 2\.12\.\d+, adopt@1\.8\)
15+
- status-success~=Test \(ubuntu-latest, 2\.12\.\d+, adopt@1\.11\)
16+
- status-success~=Test \(ubuntu-latest, 2\.13\.\d+, adopt@1\.8\)
17+
- status-success~=Test \(ubuntu-latest, 2\.13\.\d+, adopt@1\.11\)
18+
- "#files=1"
19+
- files=project/plugins.sbt
20+
actions:
21+
merge:
22+
method: merge
23+
24+
- name: automatically merge scala-steward's PRs affecting project build properties
25+
conditions:
26+
- author=scala-steward
27+
- status-success~=Test \(ubuntu-latest, 2\.12\.\d+, adopt@1\.8\)
28+
- status-success~=Test \(ubuntu-latest, 2\.12\.\d+, adopt@1\.11\)
29+
- status-success~=Test \(ubuntu-latest, 2\.13\.\d+, adopt@1\.8\)
30+
- status-success~=Test \(ubuntu-latest, 2\.13\.\d+, adopt@1\.11\)
31+
- "#files=1"
32+
- files=project/build.properties
33+
actions:
34+
merge:
35+
method: merge
36+
37+
- name: automatically merge scala-steward's PRs updating semver-patch versions
38+
conditions:
39+
- author=scala-steward
40+
- status-success~=Test \(ubuntu-latest, 2\.12\.\d+, adopt@1\.8\)
41+
- status-success~=Test \(ubuntu-latest, 2\.12\.\d+, adopt@1\.11\)
42+
- status-success~=Test \(ubuntu-latest, 2\.13\.\d+, adopt@1\.8\)
43+
- status-success~=Test \(ubuntu-latest, 2\.13\.\d+, adopt@1\.11\)
44+
- body~=labels:.*semver-patch
45+
actions:
46+
merge:
47+
method: merge
48+
49+
- name: automatically merge other scala-steward's PRs reviewed by 1 maintainer
50+
conditions:
51+
- author=scala-steward
52+
- status-success~=Test \(ubuntu-latest, 2\.12\.\d+, adopt@1\.8\)
53+
- status-success~=Test \(ubuntu-latest, 2\.12\.\d+, adopt@1\.11\)
54+
- status-success~=Test \(ubuntu-latest, 2\.13\.\d+, adopt@1\.8\)
55+
- status-success~=Test \(ubuntu-latest, 2\.13\.\d+, adopt@1\.11\)
56+
- "#approved-reviews-by>=1"
57+
actions:
58+
merge:
59+
method: merge

.github/release-drafter.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1-
name-template: '$NEXT_PATCH_VERSION'
2-
tag-template: '$NEXT_PATCH_VERSION'
1+
name-template: 'Derevo $NEXT_MINOR_VERSION'
2+
tag-template: 'v$NEXT_MINOR_VERSION'
33
categories:
4-
- title: 'Features'
4+
- title: '🚀 Features'
55
labels:
66
- 'feature'
77
- 'enhancement'
8-
- title: 'Bug Fixes'
8+
- title: '🐛 Bug Fixes'
99
labels:
1010
- 'fix'
1111
- 'bugfix'
1212
- 'bug'
13-
- title: 'Maintenance'
13+
- title: '🧰 Maintenance'
1414
labels:
1515
- 'chore'
16+
- 'dependency-update'
1617
exclude-labels:
1718
- 'skip-changelog'
1819
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
1920
template: |
2021
## Changes
22+
2123
$CHANGES

.github/workflows/ci.yml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# This file was automatically generated by sbt-github-actions using the
2+
# githubWorkflowGenerate task. You should add and commit this file to
3+
# your git repository. It goes without saying that you shouldn't edit
4+
# this file by hand! Instead, if you wish to make changes, you should
5+
# change your sbt build configuration to revise the workflow description
6+
# to meet your needs, then regenerate this file.
7+
8+
name: Continuous Integration
9+
10+
on:
11+
pull_request:
12+
branches: ['**']
13+
push:
14+
branches: ['**']
15+
tags: [v*]
16+
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
20+
jobs:
21+
build:
22+
name: Build and Test
23+
strategy:
24+
matrix:
25+
os: [ubuntu-latest]
26+
scala: [2.13.6, 2.12.14]
27+
28+
runs-on: ${{ matrix.os }}
29+
steps:
30+
- name: Checkout current branch (full)
31+
uses: actions/checkout@v2
32+
with:
33+
fetch-depth: 0
34+
35+
- name: Setup Java and Scala
36+
uses: olafurpg/setup-scala@v12
37+
with:
38+
java-version: ${{ matrix.java }}
39+
40+
- name: Cache sbt
41+
uses: actions/cache@v2
42+
with:
43+
path: |
44+
~/.sbt
45+
~/.ivy2/cache
46+
~/.coursier/cache/v1
47+
~/.cache/coursier/v1
48+
~/AppData/Local/Coursier/Cache/v1
49+
~/Library/Caches/Coursier/v1
50+
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
51+
52+
- name: Check formatting
53+
run: sbt --client '++${{ matrix.scala }}; scalafmtCheckAll; scalafmtSbtCheck'
54+
55+
- name: Check that workflows are up to date
56+
run: sbt --client '++${{ matrix.scala }}; githubWorkflowCheck'
57+
58+
- name: Build project
59+
run: sbt --client '++${{ matrix.scala }}; test'
60+
61+
- name: Compress target directories
62+
run: tar cf targets.tar modules/tests/target modules/tethys/target modules/pureconfig/target modules/catsTagless/target modules/ciris/target modules/scalacheck/target modules/circeMagnolia/target modules/circe/target target modules/tethysMagnolia/target modules/cats/target modules/core/target modules/reactivemongo/target project/target
63+
64+
- name: Upload target directories
65+
uses: actions/upload-artifact@v2
66+
with:
67+
name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }}
68+
path: targets.tar
69+
70+
publish:
71+
name: Publish Artifacts
72+
needs: [build]
73+
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
74+
strategy:
75+
matrix:
76+
os: [ubuntu-latest]
77+
scala: [2.13.6]
78+
79+
runs-on: ${{ matrix.os }}
80+
steps:
81+
- name: Checkout current branch (full)
82+
uses: actions/checkout@v2
83+
with:
84+
fetch-depth: 0
85+
86+
- name: Setup Java and Scala
87+
uses: olafurpg/setup-scala@v12
88+
with:
89+
java-version: ${{ matrix.java }}
90+
91+
- name: Cache sbt
92+
uses: actions/cache@v2
93+
with:
94+
path: |
95+
~/.sbt
96+
~/.ivy2/cache
97+
~/.coursier/cache/v1
98+
~/.cache/coursier/v1
99+
~/AppData/Local/Coursier/Cache/v1
100+
~/Library/Caches/Coursier/v1
101+
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
102+
103+
- name: Download target directories (2.13.6)
104+
uses: actions/download-artifact@v2
105+
with:
106+
name: target-${{ matrix.os }}-2.13.6-${{ matrix.java }}
107+
108+
- name: Inflate target directories (2.13.6)
109+
run: |
110+
tar xf targets.tar
111+
rm targets.tar
112+
113+
- name: Download target directories (2.12.14)
114+
uses: actions/download-artifact@v2
115+
with:
116+
name: target-${{ matrix.os }}-2.12.14-${{ matrix.java }}
117+
118+
- name: Inflate target directories (2.12.14)
119+
run: |
120+
tar xf targets.tar
121+
rm targets.tar
122+
123+
- name: Publish artifacts
124+
env:
125+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
126+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
127+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
128+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
129+
run: sbt --client '++${{ matrix.scala }}; ci-release'

.github/workflows/clean.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# This file was automatically generated by sbt-github-actions using the
2+
# githubWorkflowGenerate task. You should add and commit this file to
3+
# your git repository. It goes without saying that you shouldn't edit
4+
# this file by hand! Instead, if you wish to make changes, you should
5+
# change your sbt build configuration to revise the workflow description
6+
# to meet your needs, then regenerate this file.
7+
8+
name: Clean
9+
10+
on: push
11+
12+
jobs:
13+
delete-artifacts:
14+
name: Delete Artifacts
15+
runs-on: ubuntu-latest
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
steps:
19+
- name: Delete artifacts
20+
run: |
21+
# Customize those three lines with your repository and credentials:
22+
REPO=${GITHUB_API_URL}/repos/${{ github.repository }}
23+
24+
# A shortcut to call GitHub API.
25+
ghapi() { curl --silent --location --user _:$GITHUB_TOKEN "$@"; }
26+
27+
# A temporary file which receives HTTP response headers.
28+
TMPFILE=/tmp/tmp.$$
29+
30+
# An associative array, key: artifact name, value: number of artifacts of that name.
31+
declare -A ARTCOUNT
32+
33+
# Process all artifacts on this repository, loop on returned "pages".
34+
URL=$REPO/actions/artifacts
35+
while [[ -n "$URL" ]]; do
36+
37+
# Get current page, get response headers in a temporary file.
38+
JSON=$(ghapi --dump-header $TMPFILE "$URL")
39+
40+
# Get URL of next page. Will be empty if we are at the last page.
41+
URL=$(grep '^Link:' "$TMPFILE" | tr ',' '\n' | grep 'rel="next"' | head -1 | sed -e 's/.*<//' -e 's/>.*//')
42+
rm -f $TMPFILE
43+
44+
# Number of artifacts on this page:
45+
COUNT=$(( $(jq <<<$JSON -r '.artifacts | length') ))
46+
47+
# Loop on all artifacts on this page.
48+
for ((i=0; $i < $COUNT; i++)); do
49+
50+
# Get name of artifact and count instances of this name.
51+
name=$(jq <<<$JSON -r ".artifacts[$i].name?")
52+
ARTCOUNT[$name]=$(( $(( ${ARTCOUNT[$name]} )) + 1))
53+
54+
id=$(jq <<<$JSON -r ".artifacts[$i].id?")
55+
size=$(( $(jq <<<$JSON -r ".artifacts[$i].size_in_bytes?") ))
56+
printf "Deleting '%s' #%d, %'d bytes\n" $name ${ARTCOUNT[$name]} $size
57+
ghapi -X DELETE $REPO/actions/artifacts/$id
58+
done
59+
done

.github/workflows/release-drafter.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ name: Release Drafter
22

33
on:
44
push:
5-
# branches to consider in the event; optional, defaults to all
65
branches:
76
- master
7+
pull_request:
8+
types: [opened, reopened, synchronize]
89

910
jobs:
1011
update_release_draft:
1112
runs-on: ubuntu-latest
1213
steps:
13-
# Drafts your next Release notes as Pull Requests are merged into "master"
14-
- uses: release-drafter/[email protected]
14+
- uses: release-drafter/[email protected]
1515
env:
1616
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/scala.yml

Lines changed: 0 additions & 73 deletions
This file was deleted.

0 commit comments

Comments
 (0)