Feature/scale check #15
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
name: Scala CI/CD | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Java 8 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt' | |
java-version: '8' | |
- name: Build with sbt | |
run: sbt compile | |
- name: Test with sbt | |
run: sbt test | |
# Optional: This step uploads information to the GitHub dependency graph and unblocking Dependabot alerts for the repository | |
- name: Upload dependency graph | |
uses: scalacenter/sbt-dependency-submission@ab086b50c947c9774b70f39fc7f6e20ca2706c91 | |
publish: | |
runs-on: ubuntu-latest | |
# Add a condition to run only on the main branch | |
if: github.ref == 'refs/heads/master' | |
needs: [ build ] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Java 8 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt' | |
java-version: '8' | |
- name: Set up Git user | |
run: | | |
git config user.name "Sbt Release" | |
git config user.email "[email protected]" | |
- name: Publish with sbt | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: sbt "release with-defaults" |