diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 000000000..7d7908896 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,16 @@ +name-template: 'v$NEXT_PATCH_VERSION' +tag-template: 'v$NEXT_PATCH_VERSION' +template: | + # What's Changed + $CHANGES +categories: + - title: 'New' + label: 'type: feature' + - title: 'Bug Fixes' + label: 'type: bug' + - title: 'Maintenance' + label: 'type: maintenance' + - title: 'Documentation' + label: 'type: docs' + - title: 'Dependency Updates' + label: 'type: dependencies' diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 000000000..1a9421e63 --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,17 @@ +name: Release Drafter + +on: + push: + # branches to consider in the event; optional, defaults to all + branches: + - master + - series/1.x + +jobs: + update_release_draft: + runs-on: ubuntu-latest + steps: + # Drafts your next Release notes as Pull Requests are merged into "master" + - uses: release-drafter/release-drafter@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..e5974ad16 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,24 @@ +name: Release +on: + push: + branches: ["master", "series/1.x"] + tags: ["v*"] +jobs: + publish: + runs-on: ubuntu-latest + strategy: + matrix: + scalajsversion: ["1.x", "0.6.x"] + env: + SCALAJS_VERSION: "${{ matrix.scalajsversion == '0.6.x' && '0.6.28' || '' }}" + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: olafurpg/setup-scala@v13 + - run: sbt ci-release + env: + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} + PGP_SECRET: ${{ secrets.PGP_SECRET }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} diff --git a/build.sbt b/build.sbt index f44997487..1e2f9f46e 100644 --- a/build.sbt +++ b/build.sbt @@ -12,11 +12,14 @@ ThisBuild / crossScalaVersions := { ThisBuild / scalaVersion := crossScalaVersions.value.head val commonSettings = Seq( - version := "1.2.0-SNAPSHOT", organization := "org.scala-js", scalacOptions ++= Seq("-deprecation", "-feature", "-Xfatal-warnings") ) +val noPublishSettings = Seq( + publish / skip := true +) + normalizedName := "scalajs-dom" commonSettings @@ -58,21 +61,6 @@ scalacOptions ++= { else Nil } -scmInfo := Some(ScmInfo( - url("https://github.com/scala-js/scala-js-dom"), - "scm:git:git@github.com:scala-js/scala-js-dom.git", - Some("scm:git:git@github.com:scala-js/scala-js-dom.git"))) - -publishMavenStyle := true - -publishTo := { - val nexus = "https://oss.sonatype.org/" - if (isSnapshot.value) - Some("snapshots" at nexus + "content/repositories/snapshots") - else - Some("releases" at nexus + "service/local/staging/deploy/maven2") -} - pomExtra := ( @@ -115,9 +103,10 @@ lazy val readme = ScalatexReadme( scalaVersion := "2.12.10", scalacOptions ++= Seq("-deprecation", "-feature", "-Xfatal-warnings"), (Compile / resources) += (example / Compile / fullOptJS).value.data -) +).settings(noPublishSettings: _*) lazy val example = project. enablePlugins(ScalaJSPlugin). settings(commonSettings: _*). + settings(noPublishSettings: _*). dependsOn(root) diff --git a/project/plugins.sbt b/project/plugins.sbt index bc96d108b..7c426cd26 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -6,3 +6,5 @@ addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion) addSbtPlugin("com.lihaoyi" % "scalatex-sbt-plugin" % "0.3.11") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.0.0") + +addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7")