Skip to content

Commit

Permalink
Fix release workflow (#749)
Browse files Browse the repository at this point in the history
* Split release workflows for Scala and Scala.js
* Fix doc update path
* Install Open JDK11
* Exclude unidoc as it causes sbt error
* Split coverage test as the secret token cannot be passed to PR
  • Loading branch information
xerial committed Oct 1, 2019
1 parent a0c2fa7 commit 74f84b5
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 55 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Coverage

on: [push]

jobs:
coverage:
name: Coverage test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Scala 2.12 test with coverage report
run: ./sbt "; coverage; projectJVM/test; projectJVM/coverageReport; projectJVM/coverageAggregate"
- uses: codecov/codecov-action@v1.0.2
with:
token: ${{ secrets.CODECOV_TOKEN }} # required
file: ./projectJVM/target/scala-2.12/scoverage-report/scoverage.xml
4 changes: 2 additions & 2 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
branches:
- master
paths:
- '*.md'
- 'docs/*'
- '**/*.md'
- 'docs/**'

jobs:
doc:
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/release-js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release Scala.js

on:
push:
tags:
- v*

jobs:
publish_js:
name: Publish Scala.js
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: olafurpg/setup-gpg@v2 # Necessary for using GPG1
- name: Setup GPG
env:
PGP_SECRET: ${{ secrets.PGP_SECRET }}
run: echo $PGP_SECRET | base64 --decode | gpg --import --batch --yes
- name: Build for Scala.js 0.6.x
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
run: SCALA_JS_VERSION=0.6.29 ./sbt "projectJS/publishSigned"
- name: Build for Scala.js 1.0.x
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
run: SCALA_JS_VERSION=1.0.0-M8 ./sbt "projectJS/publishSigned"
- name: Release to Sonatype
env:
SONATYPE_USERNAME: '${{ secrets.SONATYPE_USER }}'
SONATYPE_PASSWORD: '${{ secrets.SONATYPE_PASS }}'
run: SCALA_JS_VERSION=1.0.0-M8 ./sbt sonatypeBundleRelease
29 changes: 8 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: Release Scala JVM

on:
push:
Expand All @@ -11,6 +11,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
# Install OpenJDK 11
- uses: olafurpg/setup-scala@v5
with:
java-version: adopt@1.11
- uses: olafurpg/setup-gpg@v2 # Necessary for using GPG1
- name: Setup GPG
env:
Expand All @@ -19,26 +23,9 @@ jobs:
- name: Build bundle
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
SONATYPE_USERNAME: '${{ secrets.SONATYPE_USER }}'
SONATYPE_PASSWORD: '${{ secrets.SONATYPE_PASS }}'
run: ./sbt "; + projectJVM2_13/publishSigned; + projectJVM2_12/publishSigned; sonatypeBundleRelease"
publish_js:
name: Publish Scala.js
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: olafurpg/setup-gpg@v2 # Necessary for using GPG1
- name: Setup GPG
run: ./sbt "; + projectJVM2_13/publishSigned; + projectJVM2_12/publishSigned"
- name: Release to Sonatype
env:
PGP_SECRET: ${{ secrets.PGP_SECRET }}
run: echo $PGP_SECRET | base64 --decode | gpg --import --batch --yes
- name: Build for Scala.js 0.6.x
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
run: SCALA_JS_VERSION=0.6.29 ./sbt "projectJS/publishSigned"
- name: Build for Scala.js 1.0.x
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
SONATYPE_USERNAME: '${{ secrets.SONATYPE_USER }}'
SONATYPE_PASSWORD: '${{ secrets.SONATYPE_PASS }}'
run: SCALA_JS_VERSION=1.0.0-M8 ./sbt "; projectJS/publishSigned; sonatypeBundleRelease"
run: ./sbt sonatypeBundleRelease
17 changes: 7 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: CI

on: [push, pull_request]
on:
pull_request:
push:
branches:
- master

jobs:
code_format:
Expand All @@ -15,15 +19,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Scala 2.12 test with coverage test
run: ./sbt "; coverage; projectJVM/test; projectJVM/coverageReport"
- name: Generate a coverage report
run: ./sbt projectJVM/coverageAggregate
- uses: codecov/codecov-action@v1.0.2
with:
token: ${{secrets.CODECOV_TOKEN}} #required
file: ./projectJVM/target/scala-2.12/scoverage-report/scoverage.xml

- name: Scala 2.12
run: ./sbt projectJVM/test
test_2_13:
name: Scala 2.13
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Gitter Chat][gitter-badge]][gitter-link] [![Build Status](https://travis-ci.org/wvlet/airframe.svg?branch=master)](https://travis-ci.org/wvlet/airframe) [![codecov](https://codecov.io/gh/wvlet/airframe/branch/master/graph/badge.svg)](https://codecov.io/gh/wvlet/airframe) [![scala-index][sindex-badge]][sindex-link] [![maven central][central-badge]][central-link] [![Scala.js](https://www.scala-js.org/assets/badges/scalajs-0.6.17.svg)](https://www.scala-js.org) [![Scaladoc](https://javadoc-badge.appspot.com/org.wvlet.airframe/airframe-scaladoc_2.12.svg?label=scaladoc)](https://javadoc-badge.appspot.com/org.wvlet.airframe/airframe-scaladoc_2.12)
[![Gitter Chat][gitter-badge]][gitter-link] [![Build Status](https://travis-ci.org/wvlet/airframe.svg?branch=master)](https://travis-ci.org/wvlet/airframe) [![codecov](https://codecov.io/gh/wvlet/airframe/branch/master/graph/badge.svg)](https://codecov.io/gh/wvlet/airframe) [![scala-index][sindex-badge]][sindex-link] [![maven central][central-badge]][central-link] [![Scala.js](https://www.scala-js.org/assets/badges/scalajs-0.6.17.svg)](https://www.scala-js.org)

[circleci-badge]: https://circleci.com/gh/wvlet/airframe.svg?style=svg
[circleci-link]: https://circleci.com/gh/wvlet/airframe
Expand Down
42 changes: 21 additions & 21 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -91,28 +91,28 @@ lazy val root =
}
}
}
.aggregate(scaladoc)
// .aggregate(scaladoc)
.aggregate((jvmProjects ++ jvmProjects2_12 ++ jsProjects): _*)

lazy val scaladoc =
project
.enablePlugins(ScalaUnidocPlugin)
.in(file("airframe-scaladoc"))
.settings(
buildSettings,
crossScalaVersions := targetScalaVersions,
name := "airframe-scaladoc",
// Need to exclude JS project explicitly to avoid '<type> is already defined' errors
unidocProjectFilter in (ScalaUnidoc, unidoc) :=
inAnyProject --
inProjects(jvmProjects2_12: _*) --
inProjects(airframeMacrosJS) --
inProjects(jsProjects: _*) --
inProjects(airspecProjects: _*),
// compile projects first
Defaults.packageTaskSettings(packageDoc in Compile, (unidoc in Compile).map(_.flatMap(Path.allSubpaths)))
)
.aggregate(jvmProjects: _*)
//lazy val scaladoc =
// project
// .enablePlugins(ScalaUnidocPlugin)
// .in(file("airframe-scaladoc"))
// .settings(
// buildSettings,
// crossScalaVersions := targetScalaVersions,
// name := "airframe-scaladoc",
// // Need to exclude JS project explicitly to avoid '<type> is already defined' errors
// unidocProjectFilter in (ScalaUnidoc, unidoc) :=
// inAnyProject --
// inProjects(jvmProjects2_12: _*) --
// inProjects(airframeMacrosJS) --
// inProjects(jsProjects: _*) --
// inProjects(airspecProjects: _*),
// // compile projects first
// Defaults.packageTaskSettings(packageDoc in Compile, (unidoc in Compile).map(_.flatMap(Path.allSubpaths)))
// )
// .aggregate(jvmProjects: _*)

// JVM projects for scala-community build. This should have no tricky setup and should support Scala 2.12.
lazy val communityBuildProjects: Seq[ProjectReference] = Seq(
Expand Down Expand Up @@ -198,7 +198,7 @@ lazy val projectJVM2_13 =
crossScalaVersions := targetScalaVersions
)
// Generates unidoc
.aggregate(scaladoc)
//.aggregate(scaladoc)
.aggregate(jvmProjects: _*)

// For projects only upto Scala 2.12
Expand Down

0 comments on commit 74f84b5

Please sign in to comment.