Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandrohdezma committed Nov 22, 2022
0 parents commit 2f495f7
Show file tree
Hide file tree
Showing 22 changed files with 963 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @alejandrohdezma
28 changes: 28 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Don't edit this file!
# It is automatically updated after every release of https://github.com/alejandrohdezma/sbt-ci
# If you want to suggest a change, please open a PR or issue in that repository

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

changelog:
exclude:
labels:
- ":chart_with_upwards_trend: dependency-update"
authors:
- alejandrohdezma-steward
categories:
- title: "⚠️ Breaking changes"
labels:
- ":warning: breaking"
- title: "🚀 New features"
labels:
- ":rocket: feature"
- title: "📘 Documentation updates"
labels:
- ":blue_book: documentation"
- title: "🐛 Bug fixes"
labels:
- ":beetle: bug"
- title: Other Changes
labels:
- "*"
78 changes: 78 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Don't edit this file!
# It is automatically updated after every release of https://github.com/alejandrohdezma/sbt-ci
# If you want to suggest a change, please open a PR or issue in that repository

# 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...).
#
# An example of this `ci-test` alias can be found in https://github.com/alejandrohdezma/sbt-github/blob/main/build.sbt.
#
# It will also do the following:
#
# - It will automatically label PRs based on head branch.
# - It will automatically enable auto-merge on `Scala Steward` PRs.

name: CI (PR)

on:
pull_request:
types: [opened, reopened, labeled, unlabeled, synchronize]

jobs:
labeler:
if: github.event.pull_request.state == 'OPEN' && github.actor != 'dependabot[bot]'
name: Labeler
runs-on: ubuntu-latest
steps:
- name: Update PR labels
uses: alejandrohdezma/actions/labeler@v1
if: github.event.pull_request.head.repo.full_name == github.repository

- name: Check PR labels
uses: alejandrohdezma/actions/label-check@v1

ci-steward:
if: |
github.event.pull_request.state == 'OPEN' && github.event.pull_request.head.repo.full_name == github.repository &&
github.event.pull_request.user.login == 'alejandrohdezma-steward[bot]'
name: (Scala Steward) Enable auto-merge
runs-on: ubuntu-latest
steps:
- name: Get the GitHub App installation token
uses: alejandrohdezma/actions/github-app-token@v1
id: github_app
with:
token: ${{ secrets.GH_APP_TOKEN }}

- name: Enable auto-merge for this PR
run: gh pr merge --auto --merge ${{github.event.pull_request.number}} -R "$GITHUB_REPOSITORY"
env:
GITHUB_TOKEN: ${{ steps.github_app.outputs.token }}

test:
needs: [ci-steward]
if: |
always() && !contains(needs.*.result, 'failure') && github.event.pull_request.state == 'OPEN' &&
github.actor != 'dependabot[bot]'
name: Run "sbt ci-test" on JDK ${{ matrix.jdk }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
jdk:
- 11
- 17
steps:
- name: Checkout project
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
with:
ref: ${{ github.head_ref }}

- uses: actions/setup-java@de1bb2b0c5634f0fc4438d7aa9944e68f9bf86cc # v3.6.0
with:
distribution: "liberica"
java-version: ${{ matrix.jdk }}
cache: "sbt"

- name: Run `sbt ci-test`
run: sbt ci-test
27 changes: 27 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Don't edit this file!
# It is automatically updated after every release of https://github.com/alejandrohdezma/sbt-ci
# If you want to suggest a change, please open a PR or issue in that repository

# This workflow will update PRs that are out-of-sync with the `main` branch.

name: CI (main)

on:
push:
branches: [main]

jobs:
auto-update-outdated-prs-to-latest-main:
name: Update outdated PRs to latest `main`
runs-on: ubuntu-latest
steps:
- name: Get the GitHub App installation token
uses: alejandrohdezma/actions/github-app-token@v1
id: github_app
with:
token: ${{ secrets.GH_APP_TOKEN }}

- name: Update outdated PRs to latest `main`
uses: alejandrohdezma/actions/update-outdated-prs@v1
with:
github-token: ${{ steps.github_app.outputs.token }}
84 changes: 84 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Don't edit this file!
# It is automatically updated after every release of https://github.com/alejandrohdezma/sbt-ci
# If you want to suggest a change, please open a PR or issue in that repository

# 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). An example of the `ci-publish` alias can be found in
# https://github.com/alejandrohdezma/sbt-github/blob/main/build.sbt.
#
# - 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...). An example of the `ci-docs` alias can be found in
# https://github.com/alejandrohdezma/sbt-github/blob/main/build.sbt.
#
# 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).

name: Release

on:
push:
tags: [v*]
workflow_dispatch:

jobs:
release:
name: Release a new version of the artifact
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
with:
fetch-depth: 0

- name: Check latest tag follows semantic versioning
if: github.event_name == 'push'
uses: alejandrohdezma/actions/check-semver-tag@v1

- uses: actions/setup-java@de1bb2b0c5634f0fc4438d7aa9944e68f9bf86cc # v3.6.0
with:
distribution: "liberica"
java-version: "11"
cache: "sbt"

- name: Run `sbt ci-publish`
run: sbt ci-publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}

documentation:
needs: [release]
name: Updates documentation after latest release
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
with:
fetch-depth: 0
ref: main
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}

- uses: actions/setup-java@de1bb2b0c5634f0fc4438d7aa9944e68f9bf86cc # v3.6.0
with:
distribution: "liberica"
java-version: "17"
cache: "sbt"

- name: Run `sbt ci-docs`
run: sbt ci-docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_DEPLOY_KEY: ${{ secrets.GIT_DEPLOY_KEY }}

- name: Commit changes by `sbt ci-docs`
uses: alejandrohdezma/actions/commit-and-push@v1
with:
message: Run `sbt ci-docs` [skip ci]
branch: main
89 changes: 89 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Don't edit this file!
# It is automatically updated after every release of https://github.com/alejandrohdezma/sbt-ci
# If you want to suggest a change, please open a PR or issue in that repository

# Default .gitignore for the project.

### Intellij ###

.idea
out/

### Java ###

*.class
*.log

### macOS ###

.DS_Store

### SBT ###

dist/*
target/
lib_managed/
src_managed/
project/boot/
project/plugins/project/
.history
.cache
.lib/

### Scala ###

.bloop/
**/.bloop/
project/.bloop/
.bsp
*.metals
.metals/
**/metals.sbt
project/metals.sbt

### Vim ###

# Swap
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]

# Session
Session.vim
Sessionx.vim

# Temporary
.netrwhist

# Auto-generated tag files
tags

# Persistent undo
[._]*.un~

# Coc configuration directory
.vim

### VisualStudioCode ###

.vscode

### Docusaurus ###

.docusaurus
node_modules
website/build

### sbt-scalafix-defaults ###
# Scalafix configuration file is automatically downloaded by `sbt-scalafix-defaults`
# https://github.com/alejandrohdezma/sbt-scalafix-defaults

.scalafix.conf

### sbt-scalafmt-defaults ###
# Scalafmt configuration file is automatically downloaded by `sbt-scalafmt-defaults`
# https://github.com/alejandrohdezma/sbt-scalafmt-defaults

.scalafmt.conf
Loading

0 comments on commit 2f495f7

Please sign in to comment.