Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
Co-authored-by: José Gutiérrez <[email protected]>
  • Loading branch information
alejandrohdezma and gutiory committed Dec 14, 2020
0 parents commit a18747d
Show file tree
Hide file tree
Showing 34 changed files with 1,755 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 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

enhancement: ['enhancement/*', 'feature/*']
documentation: ['docs/*', 'doc/*']
breaking-change: ['breaking/*', 'break/*']
bug: ['bug/*', 'fix/*']
tests: ['test/*', 'tests/*']
dependency-update: ['dep/*', 'dependency/*', 'dependency-update/*']
scala-steward: ['update/*']
'autorebase:opt-in': ['dep/*', 'dependency/*', 'dependency-update/*', 'update/*']
38 changes: 38 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 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

name-template: "v$NEXT_PATCH_VERSION"
tag-template: "v$NEXT_PATCH_VERSION"
exclude-labels:
- "auto-update"
- "auto-documentation"
- "auto-changelog"
categories:
- title: "⚠️ Breaking changes"
label: "breaking-change"
- title: "🚀 Features"
label: "enhancement"
- title: "📘 Documentation"
label: "documentation"
- title: "🐛 Bug Fixes"
label: "bug"
- title: "📈 Dependency updates"
labels:
- "dependency-update"
- "scala-steward"
template: |
## What's changed
$CHANGES
## Contributors to this release
$CONTRIBUTORS
replacers:
- search: '/(?:and )?@dependabot-preview(?:\[bot\])?,?/g'
replace: ''
- search: '/(?:and )?@dependabot(?:\[bot\])?,?/g'
replace: ''
- search: '/(?:and )?@scala-steward(?:\[bot\])?,?/g'
replace: ''
12 changes: 12 additions & 0 deletions .github/scripts/gpg-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 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

#!/usr/bin/env sh

echo $PGP_SECRET | base64 --decode | gpg --import --no-tty --batch --yes

echo "allow-loopback-pinentry" >>~/.gnupg/gpg-agent.conf
echo "pinentry-mode loopback" >>~/.gnupg/gpg.conf

gpg-connect-agent reloadagent /bye
83 changes: 83 additions & 0 deletions .github/settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# 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

repository:
has_wiki: false

delete_branch_on_merge: true

default_branch: master

allow_squash_merge: true
allow_merge_commit: true
allow_rebase_merge: false

branches:
- name: master
protection:
restrictions: null
enforce_admins: false
required_pull_request_reviews:
required_approving_review_count: 1
dismiss_stale_reviews: true
require_code_owner_reviews: true
required_status_checks:
strict: true
contexts:
- Run "sbt ci-test" on JDK adopt:1.8
- Run "sbt ci-test" on JDK adopt:1.11
- Run "sbt ci-test" on JDK adopt:1.15

labels:
- name: autorebase:opt-in
color: c0f276
description: Apply this label to enable automatic rebasing
- name: auto-changelog
color: e01f96
description: Automatic update of changelog file
- name: auto-documentation
color: cce1ff
description: Automatic update of documentation files
- name: auto-update
color: 63d11b
description: Workflow, documentation templates or configuration files auto-updates
- name: breaking-change
color: f0ff00
description: A breaking change that needs to be treated with consideration
- name: bug
color: d73a4a
description: Something isn't working
- name: dependency-update
color: 27d14f
description: A dependency version update
- name: documentation
color: 0075ca
description: Improvements or additions to documentation
- name: duplicate
color: cfd3d7
description: This issue or pull request already exists
- name: enhancement
color: a2eeef
description: New feature or request
- name: good first issue
color: 7057ff
description: Good for newcomers
- name: help wanted
color: 008672
description: Extra attention is needed
- name: invalid
color: e4e669
description: This doesn't seem right
- name: question
color: d876e3
description: Further information is requested
- name: scala-steward
color: c6055c
description: Dependency auto updates created by scala-steward
- name: tests
color: 04d1c3
description: Improves or modifies tests
- name: wontfix
color: ffffff
description: This will not be worked on
22 changes: 22 additions & 0 deletions .github/workflows/auto-rebase.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# 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

name: Auto-rebase PRs

on:
push:
branches-ignore:
- rebase-pull-request**
- cherry-pick-rebase-pull-request**
pull_request:
types: [labeled]

jobs:
auto-rebase:
name: Auto rebase PRs
runs-on: ubuntu-latest
steps:
- uses: Label305/[email protected]
with:
github_token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
94 changes: 94 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# 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

name: CI

on:
push:
branches: [master]
pull_request:

jobs:
label-pr:
name: Add labels to PR
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Label PR
uses: TimonVS/pr-labeler-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
spread-settings:
name: Spread repository settings
if: github.event_name == 'push' && !contains(github.event.head_commit.message, 'skip ci')
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/[email protected]
- name: Spread settings
uses: mattsb42/repo-manager@v1
with:
github-token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
pre-scala-steward:
runs-on: ubuntu-latest
name: Run `sbt fix generateCiFiles` in Scala Steward PRs
if: github.event_name == 'pull_request' && github.event.pull_request.user.login == 'alejandrohdezma' && contains(github.event.pull_request.body, 'Scala Steward')
outputs:
changes_detected: ${{ steps.push.outputs.changes_detected }}
steps:
- name: Checkout project
uses: actions/[email protected]
with:
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Setup Coursier
uses: laughedelic/coursier-setup@v1
with:
jvm: adopt:1.11
apps: sbt
- name: Enable Coursier cache
uses: coursier/cache-action@v5
- run: sbt generateCiFiles fix || sbt "generateCiFiles; scalafmtAll; scalafmtSbt" || true
- name: Push changes
id: push
uses: stefanzweifel/[email protected]
with:
commit_message: Regenerate files with `sbt generateCiFiles fix`
post-scala-steward:
runs-on: ubuntu-latest
name: Auto-merge succesfull Scala Steward PRs
needs: [label-pr, test]
if: github.event_name == 'pull_request' && github.event.pull_request.user.login == 'alejandrohdezma' && contains(github.event.pull_request.body, 'Scala Steward')
steps:
- name: Automerge Scala Steward PRs
uses: ridedott/[email protected]
with:
GITHUB_LOGIN: alejandrohdezma
GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }}
test:
needs: [pre-scala-steward]
if: always() && !contains(github.event.head_commit.message, 'skip ci') && needs.pre-scala-steward.outputs.changes_detected != 'true'
name: Run "sbt ci-test" on JDK ${{ matrix.jdk }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
jdk:
- adopt:1.8
- adopt:1.11
- adopt:1.15
steps:
- name: Checkout project
uses: actions/[email protected]
- name: Setup Coursier
uses: laughedelic/coursier-setup@v1
with:
jvm: ${{ matrix.jdk }}
apps: sbt
- name: Enable Coursier cache
uses: coursier/cache-action@v5
- name: Run checks
run: sbt ci-test
env:
GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }}
39 changes: 39 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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

name: Update documentation

on:
release:
types: [published]
workflow_dispatch:

jobs:
documentation:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/[email protected]
with:
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
ref: master
- name: Fetch tags
run: git fetch --prune --unshallow --tags
- name: Setup Coursier
uses: laughedelic/coursier-setup@v1
with:
jvm: adopt:1.8
apps: sbt
- name: Enable Coursier cache
uses: coursier/cache-action@v5
- name: Generate documentation
run: sbt ci-docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_DEPLOY_KEY: ${{ secrets.GIT_DEPLOY_KEY }}
- name: Push changes
uses: stefanzweifel/[email protected]
with:
commit_message: "Update documentation [skip ci]"
19 changes: 19 additions & 0 deletions .github/workflows/draft-next-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 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

name: Drafts/updates the next repository release

on:
push:
branches:
- master

jobs:
update_release_draft:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }}
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 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

name: Release

on:
release:
types: [published]
push:
branches: [master]

jobs:
release:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/[email protected]
- name: Fetch tags
run: git fetch --prune --unshallow --tags
- name: Setup Coursier
uses: laughedelic/coursier-setup@v1
with:
jvm: adopt:1.8
apps: sbt
- name: Enable Coursier cache
uses: coursier/cache-action@v5
- name: Setup gpg
run: .github/scripts/gpg-setup.sh
env:
PGP_SECRET: ${{ secrets.PGP_SECRET }}
- name: Release new version
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 }}
Loading

0 comments on commit a18747d

Please sign in to comment.