Skip to content

Commit e2da86a

Browse files
Initial commit
0 parents  commit e2da86a

File tree

26 files changed

+2657
-0
lines changed

26 files changed

+2657
-0
lines changed

.github/scripts/gpg-setup.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env sh
2+
3+
# from https://github.com/coursier/apps/blob/f1d2bf568bf466a98569a85c3f23c5f3a8eb5360/.github/scripts/gpg-setup.sh
4+
5+
echo "$PGP_SECRET" | base64 --decode | gpg --import --no-tty --batch --yes
6+
7+
echo "allow-loopback-pinentry" >>~/.gnupg/gpg-agent.conf
8+
echo "pinentry-mode loopback" >>~/.gnupg/gpg.conf
9+
10+
gpg-connect-agent reloadagent /bye

.github/workflows/ci.yml

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- main
6+
tags:
7+
- "v*"
8+
pull_request:
9+
10+
jobs:
11+
jvm-tests:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0
17+
submodules: true
18+
- uses: coursier/[email protected]
19+
- uses: coursier/setup-action@v1
20+
with:
21+
jvm: 8
22+
- run: |
23+
./mill -i "integration.jvm.test"
24+
if: runner.os != 'Windows'
25+
- run: |
26+
@call ./mill.bat -i "integration.jvm.test"
27+
shell: cmd
28+
if: runner.os == 'Windows'
29+
30+
native-tests:
31+
runs-on: ${{ matrix.os }}
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
os: [ubuntu-latest, windows-latest, macos-latest]
36+
steps:
37+
- uses: actions/checkout@v2
38+
with:
39+
fetch-depth: 0
40+
submodules: true
41+
- uses: coursier/[email protected]
42+
- uses: coursier/setup-action@v1
43+
with:
44+
jvm: 8
45+
- run: |
46+
./mill -i "cli.base-image.writeNativeImageScript" generate.sh "" && \
47+
./generate.sh && \
48+
./mill -i "cli.base-image.copyToArtifacts" artifacts/
49+
if: runner.os != 'Windows'
50+
- run: |
51+
@call ./mill.bat -i "cli.base-image.writeNativeImageScript" generate.bat ""
52+
@call generate.bat
53+
@call ./mill.bat -i "cli.base-image.copyToArtifacts" artifacts/
54+
shell: cmd
55+
if: runner.os == 'Windows'
56+
- uses: actions/[email protected]
57+
with:
58+
name: launchers
59+
path: artifacts/
60+
if-no-files-found: error
61+
retention-days: 1
62+
- run: ./mill -i "integration.native.test"
63+
if: github.event_name == 'push'
64+
65+
native-static-tests:
66+
runs-on: ubuntu-latest
67+
steps:
68+
- uses: actions/checkout@v2
69+
with:
70+
fetch-depth: 0
71+
submodules: true
72+
- uses: coursier/[email protected]
73+
- uses: coursier/setup-action@v1
74+
with:
75+
jvm: 8
76+
- run: |
77+
./mill -i "cli.static-image.writeNativeImageScript" generate.sh "" && \
78+
./generate.sh && \
79+
./mill -i "cli.static-image.copyToArtifacts" artifacts/
80+
- uses: actions/[email protected]
81+
with:
82+
name: launchers
83+
path: artifacts/
84+
if-no-files-found: error
85+
retention-days: 1
86+
- run: ./mill -i "integration.static.test"
87+
if: github.event_name == 'push'
88+
89+
native-mostly-static-tests:
90+
runs-on: ubuntu-latest
91+
steps:
92+
- uses: actions/checkout@v2
93+
with:
94+
fetch-depth: 0
95+
submodules: true
96+
- uses: coursier/[email protected]
97+
- uses: coursier/setup-action@v1
98+
with:
99+
jvm: 8
100+
- run: |
101+
./mill -i "cli.mostly-static-image.writeNativeImageScript" generate.sh "" && \
102+
./generate.sh && \
103+
./mill -i "cli.mostly-static-image.copyToArtifacts" artifacts/
104+
- uses: actions/[email protected]
105+
with:
106+
name: launchers
107+
path: artifacts/
108+
if-no-files-found: error
109+
retention-days: 1
110+
- run: ./mill -i "integration.mostly-static.test"
111+
if: github.event_name == 'push'
112+
113+
upload-launchers:
114+
needs: [format, jvm-tests, native-tests, native-static-tests, native-mostly-static-tests]
115+
runs-on: ubuntu-latest
116+
steps:
117+
- uses: actions/checkout@v2
118+
with:
119+
fetch-depth: 0
120+
submodules: true
121+
- uses: coursier/[email protected]
122+
- uses: coursier/setup-action@v1
123+
with:
124+
jvm: 8
125+
- uses: actions/download-artifact@v2
126+
with:
127+
name: launchers
128+
path: artifacts/
129+
- run: ./mill -i ci.upload artifacts/
130+
if: github.event_name == 'push'
131+
env:
132+
UPLOAD_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
133+
134+
format:
135+
timeout-minutes: 15
136+
runs-on: ubuntu-latest
137+
steps:
138+
- uses: actions/checkout@v3
139+
with:
140+
fetch-depth: 0
141+
submodules: true
142+
- uses: coursier/[email protected]
143+
- uses: VirtusLab/scala-cli-setup@267af2f1ed4911180b4bb25619ca4a586753cbd1
144+
with:
145+
jvm: "temurin:17"
146+
apps: scalafmt:3.0.0
147+
- run: scalafmt --check
148+
149+
publish:
150+
needs: [upload-launchers]
151+
if: github.event_name == 'push'
152+
runs-on: ubuntu-latest
153+
steps:
154+
- uses: actions/checkout@v3
155+
with:
156+
fetch-depth: 0
157+
submodules: true
158+
ssh-key: ${{ secrets.SSH_PRIVATE_KEY_SCALA_CLI }}
159+
- uses: coursier/[email protected]
160+
- uses: VirtusLab/scala-cli-setup@267af2f1ed4911180b4bb25619ca4a586753cbd1
161+
with:
162+
jvm: "temurin:17"
163+
- name: GPG setup
164+
run: .github/scripts/gpg-setup.sh
165+
env:
166+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
167+
- run: ./mill -i publishSonatype __.publishArtifacts
168+
env:
169+
PGP_PASSWORD: ${{ secrets.PGP_PASSPHRASE }}
170+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
171+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
out/

.mill-jvm-opts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-Xmx768m
2+
-Xms128m
3+
-Xss8m
4+
-Dxsbt.skip.cp.lookup=true

.mill-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.10.2

.scalafmt.conf

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
version = "3.4.3"
2+
3+
align.preset = more
4+
maxColumn = 100
5+
assumeStandardLibraryStripMargin = true
6+
indent.defnSite = 2
7+
indentOperator.topLevelOnly = false
8+
align.preset = more
9+
align.openParenCallSite = false
10+
newlines.source = keep
11+
newlines.beforeMultiline = keep
12+
newlines.afterCurlyLambdaParams = keep
13+
newlines.alwaysBeforeElseAfterCurlyIf = true
14+
15+
runner.dialect = scala213
16+
17+
rewrite.rules = [
18+
RedundantBraces
19+
RedundantParens
20+
SortModifiers
21+
]
22+
23+
rewrite.redundantBraces {
24+
ifElseExpressions = true
25+
includeUnitMethods = false
26+
stringInterpolation = true
27+
}
28+
29+
rewrite.sortModifiers.order = [
30+
"private", "final", "override", "protected",
31+
"implicit", "sealed", "abstract", "lazy"
32+
]
33+
34+
fileOverride {
35+
"glob:**/scala-3-stable/**" {
36+
runner.dialect = scala3
37+
}
38+
"glob:**/scala-3-unstable/**" {
39+
runner.dialect = scala3
40+
}
41+
"glob:**/sclicheck/**" {
42+
runner.dialect = scala3
43+
}
44+
"glob:**/gifs/**" {
45+
runner.dialect = scala3
46+
}
47+
}
48+
project.excludeFilters = [
49+
".bloop"
50+
".metals"
51+
".scala-build"
52+
"examples" # Scala 3 scripts and using directives not supported yet
53+
"out"
54+
"scala-version.scala"
55+
]

0 commit comments

Comments
 (0)