-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Oleksandr Vyshniak <[email protected]>
- Loading branch information
Showing
40 changed files
with
1,634 additions
and
0 deletions.
There are no files selected for viewing
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,18 @@ | ||
#!/bin/bash | ||
set -ev | ||
|
||
export GPG_TTY=$(tty) | ||
export SONATYPE_USERNAME=$OSSRH_USERNAME | ||
export SONATYPE_PASSWORD=$OSSRH_PASSWORD | ||
export PGP_PASSPHRASE=$GPG_PASSPHRASE | ||
|
||
gpg --version | ||
|
||
# Import gpg key | ||
echo $GPG_PRIVATE_KEY | base64 -d > private.key | ||
gpg --import --batch private.key | ||
|
||
# Deploy to Maven Central | ||
sbt sonatypeDropAll | ||
sbt publishSigned | ||
sbt sonatypeRelease |
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,17 @@ | ||
#!/bin/bash | ||
set -ev | ||
|
||
# Prepare release | ||
git config user.name "GitHub Action" | ||
git config user.email "[email protected]" | ||
|
||
PREVIOUS_RELEASE_TAG=$(git describe --abbrev=0) | ||
if [[ ${PREVIOUS_RELEASE_TAG} =~ ^[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then | ||
# Set current released version | ||
sbt -DcurrentVersion=${PREVIOUS_RELEASE_TAG} prepareRelease | ||
else | ||
echo "Cannot parse the latest release tag: ${PREVIOUS_RELEASE_TAG}. Aborting release." | ||
exit 1 | ||
fi | ||
|
||
git push origin --tags |
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,43 @@ | ||
name: Check | ||
|
||
# Controls when the workflow will run | ||
on: | ||
pull_request: | ||
branches: [ master ] | ||
push: | ||
branches: [ master ] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
|
||
jobs: | ||
check: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
fetch-depth: 0 | ||
|
||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '8' | ||
distribution: 'adopt' | ||
|
||
- name: Cache SBT | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.ivy2/cache | ||
~/.sbt | ||
key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt', 'project/**') }} | ||
|
||
- name: sbt-header-check | ||
run: sbt headerCheck | ||
|
||
- name: sbt-scala-formatter-check | ||
run: sbt scalafmtCheck scalafmtSbtCheck |
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,41 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Test"] | ||
branches: [ master ] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
release: | ||
|
||
runs-on: ubuntu-latest | ||
if: "!contains(github.event.head_commit.message, '[skip release]')" | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: master | ||
fetch-depth: 0 | ||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '8' | ||
distribution: 'adopt' | ||
- name: Cache SBT | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.ivy2/cache | ||
~/.sbt | ||
key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt', 'project/**') }} | ||
- name: Push git tag | ||
run: ./.github/scripts/push-tag.sh | ||
- name: Deploy | ||
env: | ||
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | ||
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | ||
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
GPG_PRIVATE_KEY: ${{ secrets.GPG_KEY }} | ||
run: ./.github/scripts/deploy.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,62 @@ | ||
name: Test | ||
|
||
# Controls when the workflow will run | ||
on: | ||
pull_request: | ||
branches: [ master ] | ||
push: | ||
branches: [ master ] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
|
||
jobs: | ||
test: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
fetch-depth: 0 | ||
|
||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '8' | ||
distribution: 'adopt' | ||
|
||
- name: Cache SBT | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.ivy2/cache | ||
~/.sbt | ||
key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt', 'project/**') }} | ||
|
||
- name: load-here-secret | ||
env: | ||
OLP_CREDENTIALS: ${{ secrets.OLP_CREDENTIALS }} | ||
run: mkdir -p ~/.here/ && echo $OLP_CREDENTIALS | base64 --decode > ~/.here/credentials.properties | ||
|
||
- name: load-ivy2-secret | ||
env: | ||
SBT_CREDENTIALS: ${{ secrets.SBT_CREDENTIALS }} | ||
run: mkdir -p ~/.ivy2/ && echo $SBT_CREDENTIALS | base64 --decode > ~/.ivy2/.credentials | ||
|
||
- name: build | ||
run: sbt ';sbt-bom / scripted' -Dsbt.boot.credentials="~/.ivy2/.credentials" | ||
|
||
- name: test | ||
run: sbt clean coverageOn coverage test coverageReport | ||
|
||
- name: update-version | ||
run: | | ||
CURRENT_VERSION=$(git fetch &>/dev/null; git tag -l --sort=taggerdate | grep -vE '[a-zA-Z]' | tail -n 1) | ||
echo "CURRENT_VERSION=${CURRENT_VERSION}" | tee current-version.env | ||
sed -i "s/0.0.0-SNAPSHOT/$CURRENT_VERSION/g" version.sbt | ||
- name: package | ||
run: sbt package |
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 @@ | ||
.idea/* | ||
target/ | ||
project/target/* | ||
project/project/target/* | ||
.bsp/* | ||
|
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,12 @@ | ||
style = default | ||
align.tokens = [] | ||
assumeStandardLibraryStripMargin = true | ||
maxColumn = 100 | ||
rewrite.rules = [ | ||
sortimports, | ||
sortModifiers, | ||
prefercurlyfors | ||
] | ||
version = 3.7.3 | ||
runner.dialect = scala212 | ||
docstrings.style = Asterisk |
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,81 @@ | ||
# Contributing Guide | ||
|
||
## Introduction | ||
|
||
The team gratefully accepts contributions via [pull requests](https://help.github.com/articles/about-pull-requests/). | ||
|
||
## Tests | ||
|
||
The project has integration tests based on `scripted test framework`. | ||
See https://www.scala-sbt.org/1.x/docs/Testing-sbt-plugins.html | ||
Command to run the tests: `sbt ';sbt-bom / scripted'` | ||
|
||
## Coding Standards | ||
|
||
Styles conventions: | ||
|
||
- Each Scala class should have a **Copyright Notice**: | ||
```text | ||
/* | ||
* Copyright (C) 20<x>-20<y> HERE Europe B.V. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* License-Filename: LICENSE | ||
*/ | ||
``` | ||
replace the `<x>` and `<y>` with numbers to denote the years in which the materials were created and modified. | ||
- The package name should start with `com.here` | ||
- The folder structure should reflect the package name | ||
- Basic Scala stylistic guidelines can be found [here](https://docs.scala-lang.org/style/). | ||
- It is recommended to use [Scalafmt](https://scalameta.org/scalafmt/) code formatter. The configuration is in `.scalafmt.conf` file. | ||
|
||
You may use [IntelliJ IDEA scalfmt plugin](https://plugins.jetbrains.com/plugin/8236-scalafmt) | ||
or the following SBT commands available in the project: | ||
|
||
* `scalafmtSrcAll` - formats compile sources, test sources and sbt sources | ||
* `scalafmt` - formats compile sources. | ||
* `scalafmtSbt` - formats sbt sources. | ||
* `scalafmtCheckAll` - checks that all project sources are properly formatted and fails otherwise. | ||
|
||
# Commit Signing | ||
|
||
As part of filing a pull request we ask you to sign off the | ||
[Developer Certificate of Origin](https://developercertificate.org/) (DCO) in each commit. | ||
Any Pull Request with commits that are not signed off will be reject by the | ||
[DCO check](https://probot.github.io/apps/dco/). | ||
|
||
A DCO is lightweight way for contributors to confirm that they wrote or otherwise have the right | ||
to submit code or documentation to a project. Simply add `Signed-off-by` as shown in the example below | ||
to indicate that you agree with the DCO. | ||
|
||
An example signed commit message: | ||
|
||
``` | ||
README.md: Fix minor spelling mistake | ||
Signed-off-by: John Doe <[email protected]> | ||
``` | ||
|
||
Git has the `-s` flag that can sign a commit for you, see example below: | ||
|
||
`$ git commit -s -m 'README.md: Fix minor spelling mistake'` | ||
|
||
# GitHub Actions | ||
All opened pull requests are tested by GitHub Actions before they can be merged into the target branch. | ||
After the new code is pushed to `master` GitHub Actions will run the test suite again, build the artifacts and release them | ||
to Maven Central repository. The job will automatically increase patch version during this process. | ||
If you do not want your changes to trigger a release, add the `[skip release]` flag to your commit message, | ||
e.g., `git commit -s -m "[skip release] Fixed proxy configuration"`. We recommend this for example when you update | ||
CI scripts or documentation such as README.md and CONTRIBUTING.md. |
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,16 @@ | ||
Copyright (C) 2019-2023 HERE Europe B.V. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
|
||
SPDX-License-Identifier: Apache-2.0 | ||
License-Filename: LICENSE |
Oops, something went wrong.