Giter Site home page Giter Site logo

alejandrohdezma / sbt-ci Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 1.0 744 KB

This plugin generates default GitHub Actions workflows, documentation templates and configuration files for @alejandrohdezma's Scala libraries repositories.

License: Apache License 2.0

Scala 100.00%
scala github-actions mdoc

sbt-ci's Introduction

This plugin generates default GitHub Actions workflows, documentation templates and configuration files for @alejandrohdezma's Scala libraries repositories.

Installation

Add the following line to your plugins.sbt file:

addSbtPlugin("com.alejandrohdezma" % "sbt-ci" % "2.15.0")

Usage

Once the plugin has been installed just execute sbt generateCiFiles to automatically add all the documentation, workflows and settings files to the project. You just need to ensure the sbt generateCiFiles is executed when this plugin gets updated in your repository to bring in new changes. If you use Scala Steward to keep your repositories up-to-date it is super easy. Just add the following lines to the .scala-steward.conf in the root of your repositories:

postUpdateHooks = [
  {
    command = ["sbt", "generateCiFiles"],
    commitMessage = "Run `sbt generateCiFiles`",
    groupId = "com.alejandrohdezma",
    artifactId = "sbt-ci"
  }
]

The library also enables a DocumentationPlugin on any project enabling the MdocPlugin. This plugin adds a bunch of default settings for projects using mdoc. Specifically it sets so documentation templates are read from .github/docs and written to the root directory.

Excluding files

You can exclude certain files by using the excludedFiles setting:

ThisBuild / excludedFiles += "**/*.md"

What files does it generate?

:octocat: .github/docs/LICENSE.md (copied as .github/docs/LICENSE.md)

:octocat: .github/release.yml (copied as .github/release.yml)

This file contains the template for the "auto-generated release notes"

:octocat: .github/workflows/ci.yml (copied as .github/workflows/ci.yml)

Runs sbt ci-test on the project on differnt JDKs (this task should be added to the project as a command alias containing the necessary steps to compile, check formatters, launch tests...).

Examples of this ci-test alias can be found here.

It will also do the following:

:octocat: .github/workflows/release.yml (copied as .github/workflows/release.yml)

This workflow performs two tasks:

  • Creates a release of the project by running sbt ci-publish (this task should be added to the project as a command alias containing the necessary steps to do a release). Examples of this ci-publish alias can be found here.

  • Runs sbt ci-docs on the project and pushes a commit with the changes (the ci-docs task should be added to the project as a command alias containing the necessary steps to update documentation: re-generate docs files, publish websites, update headers...). Examples of this ci-docs alias can be found here.

This workflow will launch on pushed tags. Alternatively one can launch it manually using a "workflow dispatch" to create a snapshot release (this won't trigger the documentation update).

:octocat: .gitignore (copied as .gitignore)

Default .gitignore for the project.

Using this project as a template

This project is prepared to be used as a template. For a minimum set of changes you just need to:

  • Update the list of resources to propagate in build.sbt (check for resourcesToPropagate setting).
  • Change the organization setting to your own in build.sbt.
  • Release the new plugin to Sonatype or another kind of Maven repository.

README.md should be auto-updated with the list of new resources once you execute sbt ci-docs. You can add some descriptions (as comments at the top of the file) to the propagated resources that will then be added to this file. See sbt-propagate docs for more information about what can be done.

Contributors to this project

alejandrohdezma juanpedromoreno
alejandrohdezma juanpedromoreno

sbt-ci's People

Contributors

alejandrohdezma avatar alejandrohdezma-steward[bot] avatar dependabot[bot] avatar github-actions[bot] avatar juanpedromoreno avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

juanpedromoreno

sbt-ci's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.