Skip to content

Commit 1ea2a9a

Browse files
authored
Merge pull request #78 from eed3si9n/wip/action
Use hand-written GitHub Actions
2 parents d3f4503 + 84611ed commit 1ea2a9a

File tree

5 files changed

+46
-177
lines changed

5 files changed

+46
-177
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
1-
# This file was automatically generated by sbt-github-actions using the
2-
# githubWorkflowGenerate task. You should add and commit this file to
3-
# your git repository. It goes without saying that you shouldn't edit
4-
# this file by hand! Instead, if you wish to make changes, you should
5-
# change your sbt build configuration to revise the workflow description
6-
# to meet your needs, then regenerate this file.
7-
81
name: Continuous Integration
92

103
on:
114
pull_request:
12-
branches: ['**']
135
push:
14-
branches: ['**']
15-
tags: [v*]
6+
branches: [main]
7+
tags: ['*']
168

179
env:
1810
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -23,96 +15,20 @@ jobs:
2315
strategy:
2416
matrix:
2517
os: [ubuntu-latest]
26-
scala: [2.12.17]
27-
java: [temurin@8]
28-
runs-on: ${{ matrix.os }}
29-
steps:
30-
- name: Checkout current branch (full)
31-
uses: actions/checkout@v2
32-
with:
33-
fetch-depth: 0
34-
35-
- name: Setup Java (temurin@8)
36-
if: matrix.java == 'temurin@8'
37-
uses: actions/setup-java@v2
38-
with:
39-
distribution: temurin
40-
java-version: 8
41-
42-
- name: Cache sbt
43-
uses: actions/cache@v2
44-
with:
45-
path: |
46-
~/.sbt
47-
~/.ivy2/cache
48-
~/.coursier/cache/v1
49-
~/.cache/coursier/v1
50-
~/AppData/Local/Coursier/Cache/v1
51-
~/Library/Caches/Coursier/v1
52-
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
53-
54-
- name: Check that workflows are up to date
55-
run: sbt ++${{ matrix.scala }} githubWorkflowCheck
56-
57-
- run: sbt ++${{ matrix.scala }} test scripted
58-
59-
- name: Compress target directories
60-
run: tar cf targets.tar target project/target
61-
62-
- name: Upload target directories
63-
uses: actions/upload-artifact@v2
64-
with:
65-
name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }}
66-
path: targets.tar
67-
68-
publish:
69-
name: Publish Artifacts
70-
needs: [build]
71-
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main')
72-
strategy:
73-
matrix:
74-
os: [ubuntu-latest]
75-
scala: [2.12.17]
76-
java: [temurin@8]
7718
runs-on: ${{ matrix.os }}
19+
env:
20+
# define Java options for both official sbt and sbt-extras
21+
JAVA_OPTS: -Dfile.encoding=UTF-8
22+
JVM_OPTS: -Dfile.encoding=UTF-8
7823
steps:
79-
- name: Checkout current branch (full)
80-
uses: actions/checkout@v2
81-
with:
82-
fetch-depth: 0
83-
84-
- name: Setup Java (temurin@8)
85-
if: matrix.java == 'temurin@8'
86-
uses: actions/setup-java@v2
87-
with:
88-
distribution: temurin
89-
java-version: 8
90-
91-
- name: Cache sbt
92-
uses: actions/cache@v2
93-
with:
94-
path: |
95-
~/.sbt
96-
~/.ivy2/cache
97-
~/.coursier/cache/v1
98-
~/.cache/coursier/v1
99-
~/AppData/Local/Coursier/Cache/v1
100-
~/Library/Caches/Coursier/v1
101-
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
102-
103-
- name: Download target directories (2.12.17)
104-
uses: actions/download-artifact@v2
105-
with:
106-
name: target-${{ matrix.os }}-2.12.17-${{ matrix.java }}
107-
108-
- name: Inflate target directories (2.12.17)
109-
run: |
110-
tar xf targets.tar
111-
rm targets.tar
112-
113-
- env:
114-
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
115-
PGP_SECRET: ${{ secrets.PGP_SECRET }}
116-
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
117-
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
118-
run: sbt ++${{ matrix.scala }} ci-release
24+
- uses: actions/checkout@v3
25+
- name: Set up JVM
26+
uses: actions/setup-java@v3
27+
with:
28+
distribution: 'temurin'
29+
java-version: '8'
30+
cache: 'sbt'
31+
- run: sbt -v clean test scripted
32+
- name: Scalafmt
33+
shell: bash
34+
run: sbt -v clean scalafmtSbtCheck scalafmtCheckAll

.github/workflows/clean.yml

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

.github/workflows/release.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
tags: ['*']
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
env:
11+
# define Java options for both official sbt and sbt-extras
12+
JAVA_OPTS: -Dfile.encoding=UTF-8
13+
JVM_OPTS: -Dfile.encoding=UTF-8
14+
steps:
15+
- uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0
18+
- uses: actions/setup-java@v3
19+
with:
20+
distribution: 'temurin'
21+
java-version: '8'
22+
cache: 'sbt'
23+
- run: sbt ci-release
24+
env:
25+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
26+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
27+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
28+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}

build.sbt

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,6 @@ ThisBuild / version := {
1616
ThisBuild / scalaVersion := scala212
1717
ThisBuild / crossScalaVersions := Seq(scala212)
1818

19-
ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("8"))
20-
ThisBuild / githubWorkflowBuild := Seq(WorkflowStep.Sbt(List("test", "scripted")))
21-
ThisBuild / githubWorkflowTargetTags ++= Seq("v*")
22-
ThisBuild / githubWorkflowPublish := Seq(
23-
WorkflowStep.Sbt(
24-
List("ci-release"),
25-
env = Map(
26-
"PGP_PASSPHRASE" -> "${{ secrets.PGP_PASSPHRASE }}",
27-
"PGP_SECRET" -> "${{ secrets.PGP_SECRET }}",
28-
"SONATYPE_PASSWORD" -> "${{ secrets.SONATYPE_PASSWORD }}",
29-
"SONATYPE_USERNAME" -> "${{ secrets.SONATYPE_USERNAME }}"
30-
)
31-
)
32-
)
33-
3419
lazy val root = (project in file("."))
3520
.enablePlugins(SbtPlugin)
3621
.settings(nocomma {
@@ -43,7 +28,7 @@ lazy val root = (project in file("."))
4328
"org.apache.maven.resolver" % "maven-resolver-transport-file",
4429
"org.apache.maven.resolver" % "maven-resolver-transport-http",
4530
"org.apache.maven.resolver" % "maven-resolver-transport-wagon"
46-
).map (_ % mvnResolverVersion)
31+
).map(_ % mvnResolverVersion)
4732

4833
console / initialCommands :=
4934
"""| import com.typesafe.sbt.pom._

project/plugins.sbt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
addSbtPlugin("com.eed3si9n" % "sbt-nocomma" % "0.1.1")
22
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")
3-
addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.14.2")
43
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.3")

0 commit comments

Comments
 (0)