Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 1 addition & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
branches: ["*"]
push:
branches: ["main"]
tags: ["v*"]

concurrency:
group: ci-${{ github.ref }}
Expand Down Expand Up @@ -34,36 +33,10 @@ jobs:
- name: Setup Mill
uses: jodersky/setup-mill@master
with:
mill-version: 0.10.5
mill-version: 0.10.7

- name: Run tests
run: |
mill -k --disable-ticker __.resolvedIvyDeps &&
mill -k --disable-ticker mill.scalalib.scalafmt.ScalafmtModule/checkFormatAll __.sources &&
mill -j 0 -k --disable-ticker __.test

- name: Set up GPG
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

if: startsWith(github.ref, 'refs/tags/v')
run: |
mkdir ~/.gnupg && chmod 700 ~/.gnupg
echo use-agent >> ~/.gnupg/gpg.conf
echo pinentry-mode loopback >> ~/.gnupg/gpg.conf
echo allow-loopback-pinentry >> ~/.gnupg/gpg-agent.conf
chmod 600 ~/.gnupg/*
echo RELOADAGENT | gpg-connect-agent
echo $PGP_SECRET | base64 --decode | gpg --import --no-tty --batch --yes
env:
PGP_SECRET: ${{ secrets.PGP_SECRET }}

- name: Publish release
if: startsWith(github.ref, 'refs/tags/v')
run: |
export GPG_TTY=$(tty)
mill -j 0 -k --disable-ticker mill.scalalib.PublishModule/publishAll \
--publishArtifacts __.publishArtifacts \
--sonatypeCreds ${{ secrets.SONATYPE_USERNAME }}:${{secrets.SONATYPE_PASSWORD }} \
--gpgArgs '--passphrase=${{ secrets.PGP_PASSPHRASE }},--batch,--yes,-a,-b' \
--sonatypeUri https://s01.oss.sonatype.org/service/local \
--sonatypeSnapshotUri https://s01.oss.sonatype.org/content/repositories/snapshots \
--signed true \
--release true
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release
on:
push:
branches:
- main
tags: ["*"]
jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Cache
uses: coursier/cache-action@v6

- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 11

- name: Setup Mill
uses: jodersky/setup-mill@master
with:
mill-version: 0.10.7

- name: Publish
run: mill -j 0 -k -i --disable-ticker io.kipp.mill.ci.release.ReleaseModule/publishAll
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like I see this different for every CI I look at. I see you weren't using -i, how come? I see you use --disable-ticker, does that save speed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you weren't using -i, how come?

just a mistake on my end

I see you use --disable-ticker, does that save speed?

It makes logs less verbose imho. Plus I think @keynmol was the one to implement --disable-ticker on mill, and it's important to make him feel like people care about what he builds^^

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it's purely for my ego.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damn, I'll start using it immediately then.

env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
12 changes: 8 additions & 4 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import mill.define.Target
import mill.util.Jvm
import $ivy.`com.lihaoyi::mill-contrib-bloop:$MILL_VERSION`
import $ivy.`io.github.davidgregory084::mill-tpolecat::0.3.1`
import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.2.0`
import $ivy.`io.chris-kipp::mill-ci-release::0.1.0`

import os.Path
import mill._
Expand All @@ -12,7 +12,7 @@ import scalajslib._
import scalanativelib._
import mill.scalajslib.api._
import io.github.davidgregory084._
import de.tobiasroeser.mill.vcs.version.VcsVersion
import io.kipp.mill.ci.release.CiReleaseModule

object versions {
val scala212Version = "2.12.16"
Expand Down Expand Up @@ -270,12 +270,12 @@ trait RPCCrossPlatformModule extends Module { shared =>
}
}

trait JsonRPCModule extends ScalaModule with PublishModule with scalafmt.ScalafmtModule {
trait JsonRPCModule extends ScalaModule with CiReleaseModule with scalafmt.ScalafmtModule {
def scalafmt() = T.command(reformat())
def fmt() = T.command(reformat())
def refreshedEnv = T.input(T.ctx().env)
def publishVersion = T {
if (refreshedEnv().contains("CI")) VcsVersion.vcsState().format()
if (refreshedEnv().contains("CI")) super.publishVersion()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Under the hood mill-ci-release is using this plus some goodies to add on -SNAPSHOT. For now I manually do that until I get the ok to add it lefou/mill-vcs-version#62.

else "dev"
}
override def scalacOptions = T {
Expand All @@ -294,4 +294,8 @@ trait JsonRPCModule extends ScalaModule with PublishModule with scalafmt.Scalafm
Developer("Baccata", "Olivier Mélois", "https://github.com/baccata")
)
)

override def sonatypeUri = "https://s01.oss.sonatype.org/service/local"
override def sonatypeSnapshotUri =
"https://s01.oss.sonatype.org/content/repositories/snapshots"
}