-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add release automation workflow #384
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
workflow_dispatch: | ||
|
||
jobs: | ||
publish_jvm: | ||
name: Publish | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 10000 | ||
# Fetch all tags so that sbt-dynver can find the previous release version | ||
- run: git fetch --tags -f | ||
# Install OpenJDK 11 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'zulu' | ||
java-version: '11' | ||
- name: Setup GPG | ||
env: | ||
PGP_SECRET: ${{ secrets.PGP_SECRET }} | ||
run: echo $PGP_SECRET | base64 --decode | gpg --import --batch --yes | ||
- name: Build bundle | ||
env: | ||
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} | ||
run: | | ||
./sbt publishSigned | ||
- name: Release to Sonatype | ||
env: | ||
SONATYPE_USERNAME: '${{ secrets.SONATYPE_USER }}' | ||
SONATYPE_PASSWORD: '${{ secrets.SONATYPE_PASS }}' | ||
run: ./sbt sonatypeBundleRelease |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
Global / onChangedBuildSource := ReloadOnSourceChanges | ||
|
||
name := "snappy-java" | ||
organization := "org.xerial.snappy" | ||
name := "snappy-java" | ||
organization := "org.xerial.snappy" | ||
organizationName := "xerial.org" | ||
description := "snappy-java: A fast compression/decompression library" | ||
description := "snappy-java: A fast compression/decompression library" | ||
|
||
sonatypeProfileName := "org.xerial" | ||
sonatypeProfileName := "org.xerial" | ||
ThisBuild / publishTo := sonatypePublishToBundle.value | ||
licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0.html")) | ||
homepage := Some(url("https://github.com/xerial/snappy-java")) | ||
licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0.html")) | ||
homepage := Some(url("https://github.com/xerial/snappy-java")) | ||
scmInfo := Some( | ||
ScmInfo( | ||
browseUrl = url("https://github.com/xerial/snappy-java"), | ||
|
@@ -19,6 +19,11 @@ developers := List( | |
Developer(id = "leo", name = "Taro L. Saito", email = "[email protected]", url = url("http://xerial.org/leo")) | ||
) | ||
|
||
// Use dynamic snapshot version strings for non tagged versions | ||
ThisBuild / dynverSonatypeSnapshots := true | ||
// Use coursier friendly version separator | ||
ThisBuild / dynverSeparator := "-" | ||
|
||
ThisBuild / scalaVersion := "2.12.11" | ||
|
||
// For building jars for JDK8 | ||
|
@@ -57,27 +62,27 @@ testOptions += Tests.Argument(TestFrameworks.JUnit, "-q", "-v") | |
Test / parallelExecution := false | ||
|
||
autoScalaLibrary := false | ||
crossPaths := false | ||
crossPaths := false | ||
|
||
libraryDependencies ++= Seq( | ||
"junit" % "junit" % "4.13.2" % "test", | ||
"org.codehaus.plexus" % "plexus-classworlds" % "2.7.0" % "test", | ||
"org.xerial.java" % "xerial-core" % "2.1" % "test", | ||
"junit" % "junit" % "4.13.2" % "test", | ||
"org.codehaus.plexus" % "plexus-classworlds" % "2.7.0" % "test", | ||
"org.xerial.java" % "xerial-core" % "2.1" % "test", | ||
"org.wvlet.airframe" %% "airframe-log" % "22.12.6" % "test", | ||
"org.osgi" % "org.osgi.core" % "4.3.0" % "provided", | ||
"com.github.sbt" % "junit-interface" % "0.13.3" % "test", | ||
"org.osgi" % "org.osgi.core" % "4.3.0" % "provided", | ||
"com.github.sbt" % "junit-interface" % "0.13.3" % "test", | ||
"org.apache.hadoop" % "hadoop-common" % "2.10.2" % "test" exclude ("org.xerial.snappy", "snappy-java") | ||
) | ||
|
||
enablePlugins(SbtOsgi) | ||
|
||
osgiSettings | ||
|
||
OsgiKeys.exportPackage := Seq("org.xerial.snappy", "org.xerial.snappy.buffer", "org.xerial.snappy.pool") | ||
OsgiKeys.exportPackage := Seq("org.xerial.snappy", "org.xerial.snappy.buffer", "org.xerial.snappy.pool") | ||
OsgiKeys.bundleSymbolicName := "org.xerial.snappy.snappy-java" | ||
OsgiKeys.bundleActivator := Option("org.xerial.snappy.SnappyBundleActivator") | ||
OsgiKeys.importPackage := Seq("""org.osgi.framework;version="[1.5,2)"""") | ||
OsgiKeys.requireCapability := """osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.7))"""" | ||
OsgiKeys.bundleActivator := Option("org.xerial.snappy.SnappyBundleActivator") | ||
OsgiKeys.importPackage := Seq("""org.osgi.framework;version="[1.5,2)"""") | ||
OsgiKeys.requireCapability := """osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.7))"""" | ||
|
||
OsgiKeys.additionalHeaders := Map( | ||
"Bundle-NativeCode" -> Seq( | ||
|
@@ -108,22 +113,3 @@ OsgiKeys.additionalHeaders := Map( | |
"Bundle-ActivationPolicy" -> "lazy", | ||
"Bundle-Name" -> "snappy-java: A fast compression/decompression library" | ||
) | ||
|
||
import ReleaseTransformations._ | ||
|
||
releaseTagName := { (ThisBuild / version).value } | ||
|
||
releaseProcess := Seq[ReleaseStep]( | ||
checkSnapshotDependencies, | ||
inquireVersions, | ||
runClean, | ||
runTest, | ||
setReleaseVersion, | ||
commitReleaseVersion, | ||
tagRelease, | ||
releaseStepCommand("publishSigned"), | ||
releaseStepCommand("sonatypeBundleRelease"), | ||
setNextVersion, | ||
commitNextVersion, | ||
pushChanges | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi ~ @xerial, 1.19.0 was compiled and released using Java 11, will Java 8 no longer be supported after 1.19.0? I didn't find relevant information in the release notes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, please ignore my comment temporarily
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build target is 1.8, so it should work with Java 8 https://github.com/xerial/snappy-java/blob/master/build.sbt#L30
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks very much for your reply.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xerial I'm very sorry, but I still need to bother you
I wrote a simple demo to reproduce this issue, the demo is in https://github.com/LuciferYang/snappy-java-test
run the above case with zulu 8u352
with snappy-java 1.1.8.4 the test passed
with snappy-java 1.1.9.0
the test failed as follows:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And if I run the mvn test with zulu 11, there is no above issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I create a issue #389 for this