Skip to content

Commit c850af8

Browse files
committed
Revert "use 2.x CI defs"
This reverts commit e432aea.
1 parent 569ff4e commit c850af8

File tree

2 files changed

+236
-0
lines changed

2 files changed

+236
-0
lines changed

.github/workflows/ci.yml

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
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.11.12, 2.12.20, 2.13.15, 3.3.4]
27+
java: [zulu@8, zulu@11, zulu@17, zulu@21]
28+
runs-on: ${{ matrix.os }}
29+
steps:
30+
- name: Checkout current branch (full)
31+
uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 0
34+
35+
- name: Setup Java (zulu@8)
36+
if: matrix.java == 'zulu@8'
37+
uses: actions/setup-java@v4
38+
with:
39+
distribution: zulu
40+
java-version: 8
41+
cache: sbt
42+
43+
- name: Setup Java (zulu@11)
44+
if: matrix.java == 'zulu@11'
45+
uses: actions/setup-java@v4
46+
with:
47+
distribution: zulu
48+
java-version: 11
49+
cache: sbt
50+
51+
- name: Setup Java (zulu@17)
52+
if: matrix.java == 'zulu@17'
53+
uses: actions/setup-java@v4
54+
with:
55+
distribution: zulu
56+
java-version: 17
57+
cache: sbt
58+
59+
- name: Setup Java (zulu@21)
60+
if: matrix.java == 'zulu@21'
61+
uses: actions/setup-java@v4
62+
with:
63+
distribution: zulu
64+
java-version: 21
65+
cache: sbt
66+
67+
- name: Check that workflows are up to date
68+
run: sbt -J-Xmx2G '++ ${{ matrix.scala }}' githubWorkflowCheck
69+
70+
- name: Build project
71+
run: sbt -J-Xmx2G '++ ${{ matrix.scala }}' test
72+
73+
- name: Compress target directories
74+
run: tar cf targets.tar target project/target
75+
76+
- name: Upload target directories
77+
uses: actions/upload-artifact@v4
78+
with:
79+
name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }}
80+
path: targets.tar
81+
82+
publish:
83+
name: Publish Artifacts
84+
needs: [build]
85+
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/2.') || startsWith(github.ref, 'refs/tags/v'))
86+
strategy:
87+
matrix:
88+
os: [ubuntu-latest]
89+
scala: [2.13.15]
90+
java: [zulu@8]
91+
runs-on: ${{ matrix.os }}
92+
steps:
93+
- name: Checkout current branch (full)
94+
uses: actions/checkout@v4
95+
with:
96+
fetch-depth: 0
97+
98+
- name: Setup Java (zulu@8)
99+
if: matrix.java == 'zulu@8'
100+
uses: actions/setup-java@v4
101+
with:
102+
distribution: zulu
103+
java-version: 8
104+
cache: sbt
105+
106+
- name: Setup Java (zulu@11)
107+
if: matrix.java == 'zulu@11'
108+
uses: actions/setup-java@v4
109+
with:
110+
distribution: zulu
111+
java-version: 11
112+
cache: sbt
113+
114+
- name: Setup Java (zulu@17)
115+
if: matrix.java == 'zulu@17'
116+
uses: actions/setup-java@v4
117+
with:
118+
distribution: zulu
119+
java-version: 17
120+
cache: sbt
121+
122+
- name: Setup Java (zulu@21)
123+
if: matrix.java == 'zulu@21'
124+
uses: actions/setup-java@v4
125+
with:
126+
distribution: zulu
127+
java-version: 21
128+
cache: sbt
129+
130+
- name: Download target directories (2.11.12)
131+
uses: actions/download-artifact@v4
132+
with:
133+
name: target-${{ matrix.os }}-2.11.12-${{ matrix.java }}
134+
135+
- name: Inflate target directories (2.11.12)
136+
run: |
137+
tar xf targets.tar
138+
rm targets.tar
139+
140+
- name: Download target directories (2.12.20)
141+
uses: actions/download-artifact@v4
142+
with:
143+
name: target-${{ matrix.os }}-2.12.20-${{ matrix.java }}
144+
145+
- name: Inflate target directories (2.12.20)
146+
run: |
147+
tar xf targets.tar
148+
rm targets.tar
149+
150+
- name: Download target directories (2.13.15)
151+
uses: actions/download-artifact@v4
152+
with:
153+
name: target-${{ matrix.os }}-2.13.15-${{ matrix.java }}
154+
155+
- name: Inflate target directories (2.13.15)
156+
run: |
157+
tar xf targets.tar
158+
rm targets.tar
159+
160+
- name: Download target directories (3.3.4)
161+
uses: actions/download-artifact@v4
162+
with:
163+
name: target-${{ matrix.os }}-3.3.4-${{ matrix.java }}
164+
165+
- name: Inflate target directories (3.3.4)
166+
run: |
167+
tar xf targets.tar
168+
rm targets.tar
169+
170+
- env:
171+
CI_SNAPSHOT_RELEASE: +publishSigned
172+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
173+
SONATYPE_PASSWORD: ${{ secrets.CI_S01_DEPLOY_PASSWORD }}
174+
SONATYPE_USERNAME: ${{ secrets.CI_S01_DEPLOY_USERNAME }}
175+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
176+
run: sbt -J-Xmx2G ci-release

.github/workflows/clean.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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+
shell: bash {0}
21+
run: |
22+
# Customize those three lines with your repository and credentials:
23+
REPO=${GITHUB_API_URL}/repos/${{ github.repository }}
24+
25+
# A shortcut to call GitHub API.
26+
ghapi() { curl --silent --location --user _:$GITHUB_TOKEN "$@"; }
27+
28+
# A temporary file which receives HTTP response headers.
29+
TMPFILE=$(mktemp)
30+
31+
# An associative array, key: artifact name, value: number of artifacts of that name.
32+
declare -A ARTCOUNT
33+
34+
# Process all artifacts on this repository, loop on returned "pages".
35+
URL=$REPO/actions/artifacts
36+
while [[ -n "$URL" ]]; do
37+
38+
# Get current page, get response headers in a temporary file.
39+
JSON=$(ghapi --dump-header $TMPFILE "$URL")
40+
41+
# Get URL of next page. Will be empty if we are at the last page.
42+
URL=$(grep '^Link:' "$TMPFILE" | tr ',' '\n' | grep 'rel="next"' | head -1 | sed -e 's/.*<//' -e 's/>.*//')
43+
rm -f $TMPFILE
44+
45+
# Number of artifacts on this page:
46+
COUNT=$(( $(jq <<<$JSON -r '.artifacts | length') ))
47+
48+
# Loop on all artifacts on this page.
49+
for ((i=0; $i < $COUNT; i++)); do
50+
51+
# Get name of artifact and count instances of this name.
52+
name=$(jq <<<$JSON -r ".artifacts[$i].name?")
53+
ARTCOUNT[$name]=$(( $(( ${ARTCOUNT[$name]} )) + 1))
54+
55+
id=$(jq <<<$JSON -r ".artifacts[$i].id?")
56+
size=$(( $(jq <<<$JSON -r ".artifacts[$i].size_in_bytes?") ))
57+
printf "Deleting '%s' #%d, %'d bytes\n" $name ${ARTCOUNT[$name]} $size
58+
ghapi -X DELETE $REPO/actions/artifacts/$id
59+
done
60+
done

0 commit comments

Comments
 (0)