Skip to content

Commit 842a170

Browse files
authored
add ci publishing (#51)
* add ci publishing * publish for different scala versions * wip * disable publishing demo * fix yarn caching * publish all together
1 parent e1fac16 commit 842a170

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

.github/workflows/build.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232
with:
3333
node-version: "16"
3434
cache: "yarn"
35+
cache-dependency-path: formidable/package.json
3536

3637
- name: Compile
3738
run: |
@@ -87,3 +88,37 @@ jobs:
8788
# uses: mxschmitt/action-tmate@v3
8889
# with:
8990
# limit-access-to-actor: true
91+
92+
publish:
93+
needs: [build]
94+
# if this is not a pull request, run only on main or tags pushes.
95+
# if this is a pull request, run only when 'publish' label is set
96+
if: (github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))) ||
97+
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'publish'))
98+
runs-on: ubuntu-22.04
99+
steps:
100+
- uses: actions/checkout@v2
101+
with:
102+
ref: ${{ github.event.pull_request.head.sha }}
103+
fetch-depth: 0 # full history with tags
104+
105+
- uses: coursier/cache-action@v6
106+
- uses: coursier/setup-action@v1
107+
with:
108+
jvm: adoptium:1.17
109+
apps: sbt
110+
111+
- uses: actions/setup-node@v3
112+
with:
113+
node-version: '16'
114+
cache: 'yarn'
115+
cache-dependency-path: formidable/package.json
116+
117+
- uses: olafurpg/setup-gpg@v3
118+
- name: Publish
119+
run: ENABLE_FATAL_WARNINGS=true SBT_OPTS="-XX:MaxHeapSize=6G" sbt version "git status" ci-release "git status"
120+
env:
121+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
122+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
123+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
124+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}

build.sbt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,22 @@ ThisBuild / organization := "com.github.fdietze"
55
ThisBuild / crossScalaVersions := Seq("2.13.8", "3.2.1")
66
ThisBuild / scalaVersion := "2.13.8"
77

8+
inThisBuild(
9+
List(
10+
organization := "com.github.fdietze",
11+
homepage := Some(url("https://github.com/fdietze/formidable")),
12+
licenses := Seq("MIT License" -> url("https://opensource.org/licenses/MIT")),
13+
developers := List(
14+
Developer(
15+
"fdietze",
16+
"Felix Dietze",
17+
"mail@felx.me",
18+
url("https://github.com/fdietze"),
19+
),
20+
),
21+
),
22+
)
23+
824
val versions = new {
925
val outwatch = "1.0.0-RC13"
1026
val colibri = "0.7.7"
@@ -71,6 +87,7 @@ lazy val demo = project
7187
.dependsOn(formidable)
7288
.settings(commonSettings, scalaJsMacrotaskExecutor)
7389
.settings(
90+
publish / skip := true,
7491
libraryDependencies ++= Seq(
7592
"io.github.outwatch" %%% "outwatch" % versions.outwatch,
7693
),

0 commit comments

Comments
 (0)