Skip to content
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

Release to Sonatype #74

Merged
merged 9 commits into from
Jan 17, 2022
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# https://www.scala-sbt.org/1.x/docs/Travis-CI-with-sbt.html

language: scala

scala:
Expand All @@ -10,16 +12,30 @@ branches:
only:
- master

# https://www.scala-sbt.org/1.x/docs/Travis-CI-with-sbt.html
before_install:
- git fetch --tags

stages:
- name: test
- name: release
if: ((branch = master AND type = push) OR (tag IS present)) AND NOT fork

cache:
directories:
- $HOME/.cache/coursier
- $HOME/.ivy2/cache
- $HOME/.sbt

before_cache:
- rm -fv $HOME/.ivy2/.sbt.ivy.lock
- find $HOME/.ivy2/cache -name "ivydata-*.properties" -print -delete
- find $HOME/.sbt -name "*.lock" -print -delete

script:
- sbt ciBuild
jobs:
include:
# stage="test" if no stage is specified
- name: ciBuild
script: sbt ciBuild
# run ci-release only if previous stages passed
- stage: release
script: sbt ci-release
77 changes: 34 additions & 43 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,57 @@
# Contributing

Contributions are welcomed!
Contributions are welcomed!

When contributing to this repository, please first discuss the change you wish to make via GitHub
issue before making a change. This saves everyone from wasted effort in the event that the proposed
changes need some adjustment before they are ready for submission.
When contributing to this repository, please first discuss the change you wish to make via GitHub issue before making a change. This saves everyone from wasted effort in the event that the proposed changes need some adjustment before they are ready for submission.

## Pull Request Process

1. Fork the repo, push your commits to a branch of your fork, open the PR.
2. Make sure you update the README.md where relevant.
3. Project maintainers will squash-merge Pull Requests once they are happy. There may be one or more
cycles of feedback on the PR before they are satisfied.
3. Project maintainers will squash-merge Pull Requests once they are happy. There may be one or more cycles of feedback on the PR before they are satisfied.

## Build and run tests locally

The software is written in [Scala](https://scala-lang.org/) and is built with [SBT](http://www.scala-sbt.org/).

The project is built and released for Scala versions 2.12 and 2.13.
To compile and test both versions run `sbt +test`.
The project is built and released for Scala versions 2.12 and 2.13. To compile and test both versions run `sbt +test`.

## Performing a release (for project maintainers)

1. Follow the [sbt-bintray publishing guidelines](https://github.com/sbt/sbt-bintray#publishing) to ensure you are
authenticated with Bintray. Note that you need to be a member of the `sky-uk` Bintray organization.
2. Run `sbt release` to perform the release of the binaries to Bintray.
3. Check you are happy with the draft publication of the new version [here](https://bintray.com/sky-uk/oss-maven/kafka-topic-loader)
and, if so, run `sbt bintrayRelease` to make the new version publicly accessible.
Merging a PR to master will create a snapshot release in the [Sonatype snapshot repository](https://s01.oss.sonatype.org/content/repositories/snapshots/uk/sky/).

To create a new stable release, you must tag the head of master and push it to Github.

```bash
bcarter97 marked this conversation as resolved.
Show resolved Hide resolved
git checkout master
git pull origin master
git tag -a v$VERSION -m "v$VERSION"
git push origin v$VERSION
```

> 💡 The tag **must** start with a `v` followed by the version, e.g. `v1.0.0`

This will trigger the `release` stage of the [travis workflow](./.travis.yml), and push the image to the [Sonatype release repository](https://s01.oss.sonatype.org/content/repositories/releases/uk/sky/).

## Contributor Code of Conduct

As contributors and maintainers of this project, and in the interest of fostering an open and
welcoming community, we pledge to respect all people who contribute through reporting issues,
posting feature requests, updating documentation, submitting pull requests or patches, and other
activities.
As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.

We are committed to making participation in this project a harassment-free experience for everyone,
regardless of level of experience, gender, gender identity and expression, sexual orientation,
disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery
* Personal attacks
* Trolling or insulting/derogatory comments
* Public or private harassment
* Publishing other's private information, such as physical or electronic addresses, without explicit
permission
* Other unethical or unprofessional conduct.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits,
code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. By
adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently
applying these principles to every aspect of managing this project. Project maintainers who do not
follow or enforce the Code of Conduct may be permanently removed from the project team.

This code of conduct applies both within project spaces and in public spaces when an individual is
representing the project or its community.

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an
issue or contacting one or more of the project maintainers.

This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org),
version 1.2.0, available at
[http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)
- The use of sexualized language or imagery
- Personal attacks
- Trolling or insulting/derogatory comments
- Public or private harassment
- Publishing other's private information, such as physical or electronic addresses, without explicit permission
- Other unethical or unprofessional conduct.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.

This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.

This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)
20 changes: 14 additions & 6 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,20 @@ lazy val scala213 = "2.13.7"
lazy val scala212 = "2.12.15"
lazy val supportedScalaVersions = List(scala213, scala212)

organization := "com.sky"
name := "kafka-topic-loader"
name := "kafka-topic-loader"
organization := "uk.sky"
sonatypeCredentialHost := "s01.oss.sonatype.org"
sonatypeRepository := "https://s01.oss.sonatype.org/service/local"
homepage := Some(url("https://github.com/sky-uk/kafka-topic-loader"))
lacarvalho91 marked this conversation as resolved.
Show resolved Hide resolved
licenses := List("BSD New" -> url("https://opensource.org/licenses/BSD-3-Clause"))
developers := List(
Developer(
"Sky UK OSS",
"Sky UK OSS",
sys.env.getOrElse("SONATYPE_EMAIL", "https://github.com/sky-uk/kafka-topic-loader"),
url("https://github.com/sky-uk/kafka-topic-loader")
)
)

scalaVersion := scala213
crossScalaVersions := supportedScalaVersions
Expand Down Expand Up @@ -46,10 +58,6 @@ Test / fork := true

Global / onChangedBuildSource := ReloadOnSourceChanges

releaseCrossBuild := true

licenses += ("BSD New", url("https://opensource.org/licenses/BSD-3-Clause"))

libraryDependencies ++= all

addCommandAlias("checkFix", "scalafixAll --check OrganizeImports; scalafixAll --check")
Expand Down
6 changes: 3 additions & 3 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.3")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.33")
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.10")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.3")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.33")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10")