-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from chatwork/feature/sbt-ci-release
add support for sbt-ci-release
- Loading branch information
Showing
50 changed files
with
355 additions
and
175 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Validating CODEOWNERS rules …
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 @@ | ||
* @j5ik2o @exoego |
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,6 @@ | ||
#!/bin/sh | ||
|
||
rm -rf "$HOME/.ivy2/local" || true | ||
find $HOME/.ivy2/cache -name "ivydata-*.properties" -delete || true | ||
find $HOME/.cache/coursier/v1 -name "ivydata-*.properties" -delete || true | ||
find $HOME/.sbt -name "*.lock" -delete || true |
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,6 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
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,59 @@ | ||
name: Bump Version | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
force: | ||
description: 'force release' | ||
required: false | ||
default: '0' | ||
schedule: | ||
- cron: '0 0 * * *' | ||
jobs: | ||
bump-version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
token: ${{ secrets.CW_SCALA_STEWARD_TOKEN }} | ||
- name: Calculate changes from the latest tag to HEAD | ||
id: changes | ||
run: | | ||
LATEST_TAG=$(git describe --abbrev=0 --tags) | ||
echo "latest-tag = $LATEST_TAG" | ||
COUNT=$(git log $LATEST_TAG..HEAD --pretty=format:"%s" --no-merges \ | ||
--grep='^build:' \ | ||
--grep='^ci:' \ | ||
--grep='^feat:' \ | ||
--grep='^fix:' \ | ||
--grep='^docs:' \ | ||
--grep='^style:' \ | ||
--grep='^refactor:' \ | ||
--grep='^perf:' \ | ||
--grep='^test:' \ | ||
--grep='^revert:' \ | ||
--grep='^chore:' | awk 'END{print NR}') | ||
echo "steps.changes.outputs.count = $COUNT" | ||
FORCE=${{ github.event.inputs.force }} | ||
if [[ "$FORCE" = "1" ]]; then | ||
echo "::set-output name=count::1" | ||
else | ||
echo "::set-output name=count::$COUNT" | ||
fi | ||
- name: Bump version and push tag | ||
id: tag_version | ||
uses: mathieudutour/[email protected] | ||
with: | ||
github_token: ${{ secrets.CW_SCALA_STEWARD_TOKEN }} | ||
default_bump: patch | ||
if: steps.changes.outputs.count > 0 | ||
- name: Create a GitHub release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.CW_SCALA_STEWARD_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.tag_version.outputs.new_tag }} | ||
release_name: Release ${{ steps.tag_version.outputs.new_tag }} | ||
body: ${{ steps.tag_version.outputs.changelog }} | ||
if: steps.changes.outputs.count > 0 |
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,77 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '**.scala' | ||
- '**.java' | ||
- '**.sbt' | ||
- '.scalafmt.conf' | ||
- '.github/workflows/ci.yml' | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- '**.scala' | ||
- '**.java' | ||
- '**.sbt' | ||
- '.scalafmt.conf' | ||
- '.github/workflows/ci.yml' | ||
schedule: | ||
- cron: '0 * * * *' | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
env: | ||
JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8 | ||
JVM_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8 | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- uses: olafurpg/setup-scala@v12 | ||
with: | ||
java-version: "[email protected]" | ||
- uses: coursier/cache-action@v6 | ||
- run: sbt -v lint | ||
- name: clean up | ||
run: "${GITHUB_WORKSPACE}/.github/clean-up.sh" | ||
test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
jdk: [ [email protected], [email protected], [email protected] ] | ||
scala: [ 3.0.1, 2.13.5, 2.12.13 ] | ||
runs-on: ubuntu-latest | ||
needs: lint | ||
env: | ||
JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8 | ||
JVM_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8 | ||
AWS_REGION: ap-northeast-1 | ||
TEST_TIME_FACTOR: 3 | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- uses: olafurpg/setup-scala@v12 | ||
with: | ||
java-version: ${{ matrix.jdk }} | ||
- uses: coursier/cache-action@v6 | ||
- uses: olafurpg/setup-gpg@v3 | ||
- name: sbt test | ||
run: sbt -v ++${{ matrix.scala }} test | ||
- name: clean up | ||
run: "${GITHUB_WORKSPACE}/.github/clean-up.sh" | ||
automerge: | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'pull_request' | ||
needs: test | ||
steps: | ||
- name: automerge | ||
uses: pascalgn/[email protected] | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.CW_SCALA_STEWARD_TOKEN }}" | ||
MERGE_LABELS: "" | ||
MERGE_METHOD: "rebase" | ||
MERGE_FILTER_AUTHOR: "cw-scala-steward" |
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,28 @@ | ||
name: Release | ||
on: | ||
push: | ||
tags: | ||
- v[1-9]+.[0-9]+.[0-9]+ | ||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
env: | ||
JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8 | ||
JVM_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8 | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- uses: olafurpg/setup-scala@v12 | ||
with: | ||
java-version: "[email protected]" | ||
- uses: coursier/cache-action@v6 | ||
- uses: olafurpg/setup-gpg@v3 | ||
- run: sbt -v ci-release | ||
env: | ||
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} | ||
PGP_SECRET: ${{ secrets.PGP_SECRET }} | ||
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | ||
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | ||
- name: clean up | ||
run: "${GITHUB_WORKSPACE}/.github/clean-up.sh" |
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,15 @@ | ||
name: Scala Steward | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 * * * *' | ||
jobs: | ||
scala-steward: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: scala-steward-org/scala-steward-action@v2 | ||
if: ${{ !github.event.repository.fork }} | ||
with: | ||
github-token: ${{ secrets.CW_SCALA_STEWARD_TOKEN }} | ||
author-email: "[email protected]" | ||
author-name: "cw-scala-steward" |
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,32 @@ | ||
name: Snapshot | ||
on: | ||
workflow_run: | ||
workflows: | ||
- CI | ||
types: | ||
- completed | ||
jobs: | ||
snapshot: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
env: | ||
JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8 | ||
JVM_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8 | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
ref: ${{ github.event.workflow_run.head_branch }} | ||
fetch-depth: 0 | ||
- uses: olafurpg/setup-scala@v12 | ||
with: | ||
java-version: "[email protected]" | ||
- uses: coursier/cache-action@v6 | ||
- uses: olafurpg/setup-gpg@v3 | ||
- run: sbt -v ci-release | ||
env: | ||
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} | ||
PGP_SECRET: ${{ secrets.PGP_SECRET }} | ||
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | ||
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | ||
- name: clean up | ||
run: "${GITHUB_WORKSPACE}/.github/clean-up.sh" |
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,2 @@ | ||
updatePullRequests = "always" | ||
commits.message = "build: Update ${artifactName} from ${currentVersion} to ${nextVersion}" |
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,11 @@ | ||
rules = [ | ||
//Semantic Rules | ||
//ExplicitResultTypes, // Deactivated as scalafix on Scala 3 fails otherwise | ||
RemoveUnused, | ||
NoAutoTupling, | ||
//Syntactic Rules | ||
DisableSyntax, | ||
ProcedureSyntax, | ||
LeakingImplicitClassVal, | ||
NoValInForComprehension | ||
] |
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,10 +1,11 @@ | ||
version = 2.7.5 | ||
style = defaultWithAlign | ||
danglingParentheses.preset = true | ||
indentOperator.preset = spray | ||
includeCurlyBraceInSelectChains = true | ||
maxColumn = 120 | ||
rewrite.rules = [RedundantParens, SortImports, PreferCurlyFors] | ||
spaces.inImportCurlyBraces = true | ||
binPack.literalArgumentLists = false | ||
unindentTopLevelOperators = true | ||
version = 3.0.0-RC3 | ||
style = defaultWithAlign | ||
danglingParentheses.preset = true | ||
indentOperator.preset = spray | ||
includeCurlyBraceInSelectChains = true | ||
maxColumn = 120 | ||
rewrite.rules = [RedundantParens, SortImports, PreferCurlyFors] | ||
spaces.inImportCurlyBraces = true | ||
binPack.literalArgumentLists = false | ||
unindentTopLevelOperators = true | ||
optIn.breaksInsideChains = true |
Oops, something went wrong.