Skip to content

Commit 69b57b9

Browse files
authored
Merge pull request #20 from ckipp01/mill-ci-release
chore(ci): start using mill-ci-release
2 parents 6f33c7c + 874dfe2 commit 69b57b9

File tree

3 files changed

+44
-32
lines changed

3 files changed

+44
-32
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ on:
55
branches: ["*"]
66
push:
77
branches: ["main"]
8-
tags: ["v*"]
98

109
concurrency:
1110
group: ci-${{ github.ref }}
@@ -34,36 +33,10 @@ jobs:
3433
- name: Setup Mill
3534
uses: jodersky/setup-mill@master
3635
with:
37-
mill-version: 0.10.5
36+
mill-version: 0.10.7
3837

3938
- name: Run tests
4039
run: |
4140
mill -k --disable-ticker __.resolvedIvyDeps &&
4241
mill -k --disable-ticker mill.scalalib.scalafmt.ScalafmtModule/checkFormatAll __.sources &&
4342
mill -j 0 -k --disable-ticker __.test
44-
45-
- name: Set up GPG
46-
if: startsWith(github.ref, 'refs/tags/v')
47-
run: |
48-
mkdir ~/.gnupg && chmod 700 ~/.gnupg
49-
echo use-agent >> ~/.gnupg/gpg.conf
50-
echo pinentry-mode loopback >> ~/.gnupg/gpg.conf
51-
echo allow-loopback-pinentry >> ~/.gnupg/gpg-agent.conf
52-
chmod 600 ~/.gnupg/*
53-
echo RELOADAGENT | gpg-connect-agent
54-
echo $PGP_SECRET | base64 --decode | gpg --import --no-tty --batch --yes
55-
env:
56-
PGP_SECRET: ${{ secrets.PGP_SECRET }}
57-
58-
- name: Publish release
59-
if: startsWith(github.ref, 'refs/tags/v')
60-
run: |
61-
export GPG_TTY=$(tty)
62-
mill -j 0 -k --disable-ticker mill.scalalib.PublishModule/publishAll \
63-
--publishArtifacts __.publishArtifacts \
64-
--sonatypeCreds ${{ secrets.SONATYPE_USERNAME }}:${{secrets.SONATYPE_PASSWORD }} \
65-
--gpgArgs '--passphrase=${{ secrets.PGP_PASSPHRASE }},--batch,--yes,-a,-b' \
66-
--sonatypeUri https://s01.oss.sonatype.org/service/local \
67-
--sonatypeSnapshotUri https://s01.oss.sonatype.org/content/repositories/snapshots \
68-
--signed true \
69-
--release true

.github/workflows/release.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
tags: ["*"]
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
15+
- name: Cache
16+
uses: coursier/cache-action@v6
17+
18+
- name: Setup Java
19+
uses: actions/setup-java@v2
20+
with:
21+
distribution: adopt
22+
java-version: 11
23+
24+
- name: Setup Mill
25+
uses: jodersky/setup-mill@master
26+
with:
27+
mill-version: 0.10.7
28+
29+
- name: Publish
30+
run: mill -j 0 -k -i --disable-ticker io.kipp.mill.ci.release.ReleaseModule/publishAll
31+
env:
32+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
33+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
34+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
35+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}

build.sc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import mill.define.Target
22
import mill.util.Jvm
33
import $ivy.`com.lihaoyi::mill-contrib-bloop:$MILL_VERSION`
44
import $ivy.`io.github.davidgregory084::mill-tpolecat::0.3.1`
5-
import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.2.0`
5+
import $ivy.`io.chris-kipp::mill-ci-release::0.1.0`
66

77
import os.Path
88
import mill._
@@ -12,7 +12,7 @@ import scalajslib._
1212
import scalanativelib._
1313
import mill.scalajslib.api._
1414
import io.github.davidgregory084._
15-
import de.tobiasroeser.mill.vcs.version.VcsVersion
15+
import io.kipp.mill.ci.release.CiReleaseModule
1616

1717
object versions {
1818
val scala212Version = "2.12.16"
@@ -270,12 +270,12 @@ trait RPCCrossPlatformModule extends Module { shared =>
270270
}
271271
}
272272

273-
trait JsonRPCModule extends ScalaModule with PublishModule with scalafmt.ScalafmtModule {
273+
trait JsonRPCModule extends ScalaModule with CiReleaseModule with scalafmt.ScalafmtModule {
274274
def scalafmt() = T.command(reformat())
275275
def fmt() = T.command(reformat())
276276
def refreshedEnv = T.input(T.ctx().env)
277277
def publishVersion = T {
278-
if (refreshedEnv().contains("CI")) VcsVersion.vcsState().format()
278+
if (refreshedEnv().contains("CI")) super.publishVersion()
279279
else "dev"
280280
}
281281
override def scalacOptions = T {
@@ -294,4 +294,8 @@ trait JsonRPCModule extends ScalaModule with PublishModule with scalafmt.Scalafm
294294
Developer("Baccata", "Olivier Mélois", "https://github.com/baccata")
295295
)
296296
)
297+
298+
override def sonatypeUri = "https://s01.oss.sonatype.org/service/local"
299+
override def sonatypeSnapshotUri =
300+
"https://s01.oss.sonatype.org/content/repositories/snapshots"
297301
}

0 commit comments

Comments
 (0)