Skip to content

Commit d7dd5ac

Browse files
authored
Merge pull request #106 from lolgab/add-github-actions
Add Github Actions to test and publish to Sonatype
2 parents 891bcb9 + 8704933 commit d7dd5ac

File tree

3 files changed

+52
-13
lines changed

3 files changed

+52
-13
lines changed

.github/workflows/actions.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches:
7+
- master
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions/setup-java@v1
15+
with:
16+
java-version: 8
17+
- name: Run tests
18+
run: ./mill -i -j $(nproc) __.publishArtifacts __.test
19+
20+
publish-sonatype:
21+
if: github.repository == 'com-lihaoyi/sourcecode' && contains(github.ref, 'refs/tags/')
22+
needs: test
23+
runs-on: ubuntu-latest
24+
env:
25+
SONATYPE_PGP_PRIVATE_KEY: ${{ secrets.SONATYPE_PGP_PRIVATE_KEY }}
26+
SONATYPE_PGP_PRIVATE_KEY_PASSWORD: ${{ secrets.SONATYPE_PGP_PRIVATE_KEY_PASSWORD }}
27+
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
28+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
29+
LANG: "en_US.UTF-8"
30+
LC_MESSAGES: "en_US.UTF-8"
31+
LC_ALL: "en_US.UTF-8"
32+
steps:
33+
- uses: actions/checkout@v2
34+
- uses: actions/setup-java@v1
35+
with:
36+
java-version: 8
37+
- name: Publish to Maven Central
38+
run: |
39+
if [[ $(git tag --points-at HEAD) != '' ]]; then
40+
echo "$SONATYPE_PGP_PRIVATE_KEY" | base64 --decode | gpg --import
41+
./mill -i mill.scalalib.PublishModule/publishAll \
42+
--sonatypeCreds $SONATYPE_USER:$SONATYPE_PASSWORD \
43+
--gpgArgs --passphrase=$SONATYPE_PGP_PRIVATE_KEY_PASSWORD,--no-tty,--pinentry-mode,loopback,--batch,--yes,-a,-b \
44+
--publishArtifacts __.publishArtifacts \
45+
--readTimeout 600000 \
46+
--awaitTimeout 600000 \
47+
--release true \
48+
--signed true
49+
fi

.travis.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

build.sc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import mill._, scalalib._, scalajslib._, scalanativelib._, publish._
2+
import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version_mill0.9:0.1.1`
3+
import de.tobiasroeser.mill.vcs.version.VcsVersion
24

35
val dottyVersions = sys.props.get("dottyVersion").toList
46

@@ -18,7 +20,7 @@ val scalaNativeVersions = for {
1820
trait SourcecodeModule extends PublishModule {
1921
def artifactName = "sourcecode"
2022

21-
def publishVersion = "0.2.3"
23+
def publishVersion = VcsVersion.vcsState().format()
2224

2325
def pomSettings = PomSettings(
2426
description = artifactName(),

0 commit comments

Comments
 (0)