Skip to content

Commit fee4c06

Browse files
authored
Merge pull request #475 from scala-js/topic/setup-ci-release
Setup CI release
2 parents 6cd62c5 + 905a741 commit fee4c06

File tree

5 files changed

+65
-17
lines changed

5 files changed

+65
-17
lines changed

.github/release-drafter.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name-template: 'v$NEXT_PATCH_VERSION'
2+
tag-template: 'v$NEXT_PATCH_VERSION'
3+
template: |
4+
# What's Changed
5+
$CHANGES
6+
categories:
7+
- title: 'New'
8+
label: 'type: feature'
9+
- title: 'Bug Fixes'
10+
label: 'type: bug'
11+
- title: 'Maintenance'
12+
label: 'type: maintenance'
13+
- title: 'Documentation'
14+
label: 'type: docs'
15+
- title: 'Dependency Updates'
16+
label: 'type: dependencies'

.github/workflows/release-drafter.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
# branches to consider in the event; optional, defaults to all
6+
branches:
7+
- master
8+
- series/1.x
9+
10+
jobs:
11+
update_release_draft:
12+
runs-on: ubuntu-latest
13+
steps:
14+
# Drafts your next Release notes as Pull Requests are merged into "master"
15+
- uses: release-drafter/release-drafter@v5
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Release
2+
on:
3+
push:
4+
branches: ["master", "series/1.x"]
5+
tags: ["v*"]
6+
jobs:
7+
publish:
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
scalajsversion: ["1.x", "0.6.x"]
12+
env:
13+
SCALAJS_VERSION: "${{ matrix.scalajsversion == '0.6.x' && '0.6.28' || '' }}"
14+
steps:
15+
- uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0
18+
- uses: olafurpg/setup-scala@v13
19+
- run: sbt ci-release
20+
env:
21+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
22+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
23+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
24+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}

build.sbt

+6-17
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@ ThisBuild / crossScalaVersions := {
1212
ThisBuild / scalaVersion := crossScalaVersions.value.head
1313

1414
val commonSettings = Seq(
15-
version := "1.2.0-SNAPSHOT",
1615
organization := "org.scala-js",
1716
scalacOptions ++= Seq("-deprecation", "-feature", "-Xfatal-warnings")
1817
)
1918

19+
val noPublishSettings = Seq(
20+
publish / skip := true
21+
)
22+
2023
normalizedName := "scalajs-dom"
2124

2225
commonSettings
@@ -58,21 +61,6 @@ scalacOptions ++= {
5861
else Nil
5962
}
6063

61-
scmInfo := Some(ScmInfo(
62-
url("https://github.com/scala-js/scala-js-dom"),
63-
"scm:git:[email protected]:scala-js/scala-js-dom.git",
64-
Some("scm:git:[email protected]:scala-js/scala-js-dom.git")))
65-
66-
publishMavenStyle := true
67-
68-
publishTo := {
69-
val nexus = "https://oss.sonatype.org/"
70-
if (isSnapshot.value)
71-
Some("snapshots" at nexus + "content/repositories/snapshots")
72-
else
73-
Some("releases" at nexus + "service/local/staging/deploy/maven2")
74-
}
75-
7664
pomExtra := (
7765
<developers>
7866
<developer>
@@ -115,9 +103,10 @@ lazy val readme = ScalatexReadme(
115103
scalaVersion := "2.12.10",
116104
scalacOptions ++= Seq("-deprecation", "-feature", "-Xfatal-warnings"),
117105
(Compile / resources) += (example / Compile / fullOptJS).value.data
118-
)
106+
).settings(noPublishSettings: _*)
119107

120108
lazy val example = project.
121109
enablePlugins(ScalaJSPlugin).
122110
settings(commonSettings: _*).
111+
settings(noPublishSettings: _*).
123112
dependsOn(root)

project/plugins.sbt

+2
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion)
66
addSbtPlugin("com.lihaoyi" % "scalatex-sbt-plugin" % "0.3.11")
77

88
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.0.0")
9+
10+
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7")

0 commit comments

Comments
 (0)