From b6cd0a43eb86c0d056623ad554fef9d3abeb44cc Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Thu, 12 Aug 2021 02:07:49 +0000 Subject: [PATCH 1/5] Setup CI release --- .github/workflows/release.yml | 23 +++++++++++++++++++++++ build.sbt | 11 ++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..8f42d8c54 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,23 @@ +name: Release +on: + push: + tags: ["v*"] +jobs: + publish: + runs-on: ubuntu-20.04 + strategy: + matrix: + scalajsversion: ["1.x", "0.6.x"] + env: + SCALAJS_VERSION: "${{ matrix.scalajsversion == '0.6.x' && '0.6.28' || '' }}" + steps: + - uses: actions/checkout@v2.3.4 + with: + fetch-depth: 0 + - uses: olafurpg/setup-scala@v10 + - 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..83ff13e3e 100644 --- a/build.sbt +++ b/build.sbt @@ -17,6 +17,14 @@ val commonSettings = Seq( scalacOptions ++= Seq("-deprecation", "-feature", "-Xfatal-warnings") ) +val noPublishSettings = Seq( + skip in publish := true, + publish := (()), + publishLocal := (()), + publishArtifact := false, + publishTo := None +) + normalizedName := "scalajs-dom" commonSettings @@ -115,9 +123,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) From 8b3367ad35fc2d82d36b8775594fd5737fed5320 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Thu, 12 Aug 2021 02:24:08 +0000 Subject: [PATCH 2/5] Add the sbt-ci-release plugin --- build.sbt | 16 ---------------- project/plugins.sbt | 2 ++ 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/build.sbt b/build.sbt index 83ff13e3e..a1ad9a2e5 100644 --- a/build.sbt +++ b/build.sbt @@ -12,7 +12,6 @@ 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") ) @@ -66,21 +65,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 := ( 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") From b97bc658956dd2706ebbf7edf5f4122bde750838 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Thu, 12 Aug 2021 02:25:30 +0000 Subject: [PATCH 3/5] Address review, thanks! --- .github/workflows/release.yml | 4 ++-- build.sbt | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8f42d8c54..dfb78eca3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,10 +11,10 @@ jobs: env: SCALAJS_VERSION: "${{ matrix.scalajsversion == '0.6.x' && '0.6.28' || '' }}" steps: - - uses: actions/checkout@v2.3.4 + - uses: actions/checkout@v2 with: fetch-depth: 0 - - uses: olafurpg/setup-scala@v10 + - uses: olafurpg/setup-scala@v13 - run: sbt ci-release env: PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} diff --git a/build.sbt b/build.sbt index a1ad9a2e5..1e2f9f46e 100644 --- a/build.sbt +++ b/build.sbt @@ -17,11 +17,7 @@ val commonSettings = Seq( ) val noPublishSettings = Seq( - skip in publish := true, - publish := (()), - publishLocal := (()), - publishArtifact := false, - publishTo := None + publish / skip := true ) normalizedName := "scalajs-dom" From b8b4c1998e37ad402fc7ae9c1ceabc35c21a8d47 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Thu, 12 Aug 2021 02:45:35 +0000 Subject: [PATCH 4/5] Couple more tweaks --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dfb78eca3..e5974ad16 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,10 +1,11 @@ name: Release on: push: + branches: ["master", "series/1.x"] tags: ["v*"] jobs: publish: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: matrix: scalajsversion: ["1.x", "0.6.x"] From 905a7414aa8bb24aa107829f9fcd060412189775 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Thu, 12 Aug 2021 02:50:38 +0000 Subject: [PATCH 5/5] Add release drafter, boopickle-inspired --- .github/release-drafter.yml | 16 ++++++++++++++++ .github/workflows/release-drafter.yml | 17 +++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 .github/release-drafter.yml create mode 100644 .github/workflows/release-drafter.yml 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 }}