Skip to content

Commit 514a532

Browse files
authored
334 - publish artifacts (#335)
1 parent 1dbb5c1 commit 514a532

File tree

5 files changed

+94
-61
lines changed

5 files changed

+94
-61
lines changed

.github/workflows/ci.yml

Lines changed: 38 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ on:
1515
tags: [v*]
1616

1717
env:
18-
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
19-
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
20-
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
21-
PGP_SECRET: ${{ secrets.PGP_SECRET }}
2218
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2319

2420
jobs:
@@ -27,25 +23,28 @@ jobs:
2723
strategy:
2824
matrix:
2925
os: [ubuntu-latest]
30-
scala: [3.3.3, 2.13.11, 2.12.18]
31-
java: [graal_22.3.2@17]
26+
scala: [3.3.4, 2.13.15, 2.12.20]
27+
java: [graal_graalvm@17]
3228
runs-on: ${{ matrix.os }}
3329
steps:
3430
- name: Checkout current branch (full)
35-
uses: actions/checkout@v3
31+
uses: actions/checkout@v4
3632
with:
3733
fetch-depth: 0
3834

39-
- name: Setup GraalVM (graal_22.3.2@17)
40-
if: matrix.java == 'graal_22.3.2@17'
35+
- name: Setup GraalVM (graal_graalvm@17)
36+
if: matrix.java == 'graal_graalvm@17'
4137
uses: graalvm/setup-graalvm@v1
4238
with:
43-
version: 22.3.2
4439
java-version: 17
40+
distribution: graalvm
4541
components: native-image
4642
github-token: ${{ secrets.GITHUB_TOKEN }}
4743
cache: sbt
4844

45+
- name: Setup sbt
46+
uses: sbt/setup-sbt@v1
47+
4948
- name: Start containers
5049
run: |
5150
chmod -R 777 ./ftp-home/
@@ -61,7 +60,7 @@ jobs:
6160
run: tar cf targets.tar target project/target
6261

6362
- name: Upload target directories
64-
uses: actions/upload-artifact@v3
63+
uses: actions/upload-artifact@v4
6564
with:
6665
name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }}
6766
path: targets.tar
@@ -73,55 +72,62 @@ jobs:
7372
strategy:
7473
matrix:
7574
os: [ubuntu-latest]
76-
scala: [3.3.3]
77-
java: [graal_22.3.2@17]
75+
scala: [3.3.4]
76+
java: [graal_graalvm@17]
7877
runs-on: ${{ matrix.os }}
7978
steps:
8079
- name: Checkout current branch (full)
81-
uses: actions/checkout@v3
80+
uses: actions/checkout@v4
8281
with:
8382
fetch-depth: 0
8483

85-
- name: Setup GraalVM (graal_22.3.2@17)
86-
if: matrix.java == 'graal_22.3.2@17'
84+
- name: Setup GraalVM (graal_graalvm@17)
85+
if: matrix.java == 'graal_graalvm@17'
8786
uses: graalvm/setup-graalvm@v1
8887
with:
89-
version: 22.3.2
9088
java-version: 17
89+
distribution: graalvm
9190
components: native-image
9291
github-token: ${{ secrets.GITHUB_TOKEN }}
9392
cache: sbt
9493

95-
- name: Download target directories (3.3.3)
96-
uses: actions/download-artifact@v3
94+
- name: Setup sbt
95+
uses: sbt/setup-sbt@v1
96+
97+
- name: Download target directories (3.3.4)
98+
uses: actions/download-artifact@v4
9799
with:
98-
name: target-${{ matrix.os }}-3.3.3-${{ matrix.java }}
100+
name: target-${{ matrix.os }}-3.3.4-${{ matrix.java }}
99101

100-
- name: Inflate target directories (3.3.3)
102+
- name: Inflate target directories (3.3.4)
101103
run: |
102104
tar xf targets.tar
103105
rm targets.tar
104106
105-
- name: Download target directories (2.13.11)
106-
uses: actions/download-artifact@v3
107+
- name: Download target directories (2.13.15)
108+
uses: actions/download-artifact@v4
107109
with:
108-
name: target-${{ matrix.os }}-2.13.11-${{ matrix.java }}
110+
name: target-${{ matrix.os }}-2.13.15-${{ matrix.java }}
109111

110-
- name: Inflate target directories (2.13.11)
112+
- name: Inflate target directories (2.13.15)
111113
run: |
112114
tar xf targets.tar
113115
rm targets.tar
114116
115-
- name: Download target directories (2.12.18)
116-
uses: actions/download-artifact@v3
117+
- name: Download target directories (2.12.20)
118+
uses: actions/download-artifact@v4
117119
with:
118-
name: target-${{ matrix.os }}-2.12.18-${{ matrix.java }}
120+
name: target-${{ matrix.os }}-2.12.20-${{ matrix.java }}
119121

120-
- name: Inflate target directories (2.12.18)
122+
- name: Inflate target directories (2.12.20)
121123
run: |
122124
tar xf targets.tar
123125
rm targets.tar
124126
125-
- uses: olafurpg/setup-gpg@v3
126-
127-
- run: sbt ci-release
127+
- name: Publish project
128+
env:
129+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
130+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
131+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
132+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
133+
run: sbt ci-release

.github/workflows/clean.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1818
steps:
1919
- name: Delete artifacts
20+
shell: bash {0}
2021
run: |
2122
# Customize those three lines with your repository and credentials:
2223
REPO=${GITHUB_API_URL}/repos/${{ github.repository }}
@@ -25,7 +26,7 @@ jobs:
2526
ghapi() { curl --silent --location --user _:$GITHUB_TOKEN "$@"; }
2627
2728
# A temporary file which receives HTTP response headers.
28-
TMPFILE=/tmp/tmp.$$
29+
TMPFILE=$(mktemp)
2930
3031
# An associative array, key: artifact name, value: number of artifacts of that name.
3132
declare -A ARTCOUNT

README.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,38 @@ pub rsa4096 2018-08-22 [SC]
185185
uid [ultimate] your name <you@example.com>
186186
sub rsa4096 2018-08-22 [E]
187187
188+
$>LONG_ID=1234517530FB96F147C6A146A326F592D39AAAAA
189+
188190
#send key to server
189-
$> gpg --keyserver keyserver.ubuntu.com --send-keys $LONG_ID
191+
$> gpg --keyserver hkp://keyserver.ubuntu.com --send-key $LONG_ID && \
192+
gpg --keyserver hkp://pgp.mit.edu --send-key $LONG_ID && \
193+
gpg --keyserver hkp://pool.sks-keyservers.net --send-key $LONG_ID
194+
195+
196+
197+
198+
```
190199

191-
# declare in travis (settings) PGP_SECRET in base64 (with no return carriage), dont put "" around the value !
200+
2. Github secrets
201+
202+
declare in github / repo / settings / secrets (new repository secret)
203+
204+
```
205+
# PGP_SECRET in base64 (with no return carriage), dont put "" around the value !
192206
gpg --armor --export-secret-keys $LONG_ID | base64 -w0 | pbcopy
193207
194-
# declare in travis (settings) PGP_PASSPHRASE in plain text
208+
# declare in github (settings) PGP_PASSPHRASE in plain text
195209
The randomly generated password you used to create a fresh gpg key
210+
211+
212+
# declare in github (settings) SONATYPE_PASSWORD in plain text
213+
The password you use to log into https://s01.oss.sonatype.org/ (or https://oss.sonatype.org/ if your Sonatype account was created before February 2021).
214+
***IMPORTANT*** Login s01.oss.sonatype.org and after profile, and select "User token"
215+
Alternatively, the password part of the user token if you generated one above.
216+
217+
# declare in github (settings) SONATYPE_USERNAME in plain text
218+
***IMPORTANT*** Login s01.oss.sonatype.org, got to profile, and select "User token"
219+
Alternatively, the username part of the user token if you generated one above.
196220
```
197221

198222
2. create a tag and push

build.sbt

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
lazy val scala212 = "2.12.18"
2-
lazy val scala213 = "2.13.11"
3-
lazy val scala330 = "3.3.3"
1+
lazy val scala212 = "2.12.20"
2+
lazy val scala213 = "2.13.15"
3+
lazy val scala330 = "3.3.4"
44

5-
val fs2Version = "3.8.0"
5+
val fs2Version = "3.11.0"
66

77
inThisBuild(
88
List(
@@ -17,7 +17,7 @@ inThisBuild(
1717
)
1818
ThisBuild / scalaVersion := scala330
1919
ThisBuild / crossScalaVersions := List(scala330, scala213, scala212)
20-
ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.graalvm("22.3.2", "17"))
20+
ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.graalvm(Graalvm.Distribution("graalvm"), "17"))
2121
ThisBuild / versionScheme := Some("early-semver")
2222

2323
ThisBuild / githubWorkflowBuildPreamble ++= Seq(
@@ -30,27 +30,29 @@ ThisBuild / githubWorkflowBuildPreamble ++= Seq(
3030
name = Some("Start containers")
3131
)
3232
)
33+
3334
ThisBuild / githubWorkflowBuild := Seq(
3435
WorkflowStep.Sbt(List("check", "test"))
3536
)
3637

37-
//sbt-ci-release settings
38-
ThisBuild / githubWorkflowPublishPreamble := Seq(
39-
WorkflowStep.Use(UseRef.Public("olafurpg", "setup-gpg", "v3"))
40-
)
41-
4238
ThisBuild / githubWorkflowTargetTags ++= Seq("v*")
4339
ThisBuild / githubWorkflowPublishTargetBranches := Seq(
4440
RefPredicate.StartsWith(Ref.Branch("master")),
4541
RefPredicate.StartsWith(Ref.Tag("v"))
4642
)
47-
ThisBuild / githubWorkflowPublish := Seq(WorkflowStep.Sbt(List("ci-release")))
48-
ThisBuild / githubWorkflowEnv ++= List(
49-
"PGP_PASSPHRASE",
50-
"PGP_SECRET",
51-
"SONATYPE_PASSWORD",
52-
"SONATYPE_USERNAME"
53-
).map(envKey => envKey -> s"$${{ secrets.$envKey }}").toMap
43+
44+
ThisBuild / githubWorkflowPublish := Seq(
45+
WorkflowStep.Sbt(
46+
commands = List("ci-release"),
47+
name = Some("Publish project"),
48+
env = Map(
49+
"PGP_PASSPHRASE" -> "${{ secrets.PGP_PASSPHRASE }}",
50+
"PGP_SECRET" -> "${{ secrets.PGP_SECRET }}",
51+
"SONATYPE_PASSWORD" -> "${{ secrets.SONATYPE_PASSWORD }}",
52+
"SONATYPE_USERNAME" -> "${{ secrets.SONATYPE_USERNAME }}"
53+
)
54+
)
55+
)
5456

5557
lazy val `fs2-ftp` = project
5658
.in(file("."))
@@ -80,13 +82,13 @@ lazy val `fs2-ftp` = project
8082
libraryDependencies ++= Seq(
8183
"co.fs2" %% "fs2-core" % fs2Version,
8284
"co.fs2" %% "fs2-io" % fs2Version,
83-
"org.scala-lang.modules" %% "scala-collection-compat" % "2.11.0",
85+
"org.scala-lang.modules" %% "scala-collection-compat" % "2.12.0",
8486
"com.hierynomus" % "sshj" % "0.39.0",
8587
"commons-net" % "commons-net" % "3.11.1",
86-
"org.apache.logging.log4j" % "log4j-api" % "2.20.0" % Test,
87-
"org.apache.logging.log4j" % "log4j-core" % "2.20.0" % Test,
88-
"org.apache.logging.log4j" % "log4j-slf4j-impl" % "2.20.0" % Test,
89-
"org.scalatest" %% "scalatest" % "3.2.15" % Test
88+
"org.apache.logging.log4j" % "log4j-api" % "2.23.1" % Test,
89+
"org.apache.logging.log4j" % "log4j-core" % "2.23.1" % Test,
90+
"org.apache.logging.log4j" % "log4j-slf4j-impl" % "2.23.1" % Test,
91+
"org.scalatest" %% "scalatest" % "3.2.19" % Test
9092
)
9193
)
9294

project/plugins.sbt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.9.3")
1+
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.2.1")
22
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
3-
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10")
4-
addSbtPlugin("com.github.sbt" % "sbt-github-actions" % "0.15.0")
3+
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.7.0")
4+
addSbtPlugin("com.github.sbt" % "sbt-github-actions" % "0.24.0")

0 commit comments

Comments
 (0)