Skip to content

Commit

Permalink
Use mill-ci-release
Browse files Browse the repository at this point in the history
  • Loading branch information
sake92 committed Jun 9, 2023
1 parent 6c50cda commit e541a9d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 33 deletions.
41 changes: 13 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,25 @@
name: Release
on:
push:
branches: [master, main]
branches:
- main
tags: ["*"]
jobs:
publish:
if: github.repository == 'sake92/tupson' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
env:
SONATYPE_PGP_PRIVATE_KEY: ${{ secrets.PGP_SECRET }}
SONATYPE_PGP_PRIVATE_KEY_PASSWORD: ${{ secrets.PGP_PASSPHRASE }}
SONATYPE_USER: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
LANG: "en_US.UTF-8"
LC_MESSAGES: "en_US.UTF-8"
LC_ALL: "en_US.UTF-8"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 8
fetch-depth: 0
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Publish to Maven Central
run: |
echo $SONATYPE_PGP_PRIVATE_KEY | base64 --decode > gpg_key
gpg --import --no-tty --batch --yes gpg_key
rm gpg_key
./mill -i mill.scalalib.PublishModule/publishAll \
--sonatypeCreds $SONATYPE_USER:$SONATYPE_PASSWORD \
--gpgArgs --passphrase=$SONATYPE_PGP_PRIVATE_KEY_PASSWORD,--no-tty,--pinentry-mode,loopback,--batch,--yes,-a,-b \
--publishArtifacts __.publishArtifacts \
--readTimeout 600000 \
--awaitTimeout 600000 \
--release true \
--signed true
run: ./mill -i io.kipp.mill.ci.release.ReleaseModule/publishAll
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
8 changes: 3 additions & 5 deletions build.sc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import mill._, scalalib._, scalajslib._, publish._, scalafmt._

import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.1.4`
import de.tobiasroeser.mill.vcs.version.VcsVersion
import $ivy.`io.chris-kipp::mill-ci-release::0.1.9`
import io.kipp.mill.ci.release.CiReleaseModule

object tupson extends Module {

Expand Down Expand Up @@ -47,12 +47,10 @@ trait TupsonCommonModule extends SbtModule with ScalafmtModule {
}
}

trait TupsonPublishModule extends TupsonCommonModule with PublishModule {
trait TupsonPublishModule extends TupsonCommonModule with CiReleaseModule {

def artifactName = "tupson"

override def publishVersion: T[String] = VcsVersion.vcsState().format()

def pomSettings = PomSettings(
organization = "ba.sake",
url = "https://github.com/sake92/tupson",
Expand Down

0 comments on commit e541a9d

Please sign in to comment.