Merge pull request #408 from scala-steward/update/sbt-1.10.3 #501
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: CI | |
on: | |
push: | |
branches: [master] | |
tags: ["*.*.*"] | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.sbt | |
~/.cache/coursier/v1 | |
~/.ivy2/cache | |
key: ${{ runner.os }}-build-cache-${{ hashFiles('*.sbt') }}-${{ hashFiles('project/*') }} | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: "8" | |
distribution: zulu | |
- run: sbt scalafmtCheckAll scalafmtSbtCheck test publishLocal | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: sbt-updates | |
path: /home/runner/.ivy2/local | |
scripted: | |
runs-on: ubuntu-latest | |
needs: build | |
strategy: | |
matrix: | |
include: | |
- { sbt: 1_0_0, java: 8 } | |
- { sbt: latest, java: 8 } | |
- { sbt: 1_0_0, java: 11 } | |
- { sbt: latest, java: 11 } | |
- { sbt: latest, java: 14 } | |
fail-fast: false | |
name: test (java ${{ matrix.java }}, sbt ${{ matrix.sbt }}) | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.sbt | |
~/.cache/coursier/v1 | |
~/.ivy2/cache | |
key: ${{ runner.os }}-scripted-cache-${{ matrix.sbt }}-${{ hashFiles('*.sbt') }}-${{ hashFiles('project/*') }} | |
- uses: actions/download-artifact@v3 | |
with: | |
name: sbt-updates | |
path: /home/runner/.ivy2/local | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: "${{ matrix.java }}" | |
distribution: zulu | |
- run: sbt sbt-updates-${{ matrix.sbt }}/scripted | |
env: | |
CI: "true" | |
test: | |
runs-on: ubuntu-latest | |
needs: scripted | |
steps: | |
- run: "true" | |
publish: | |
runs-on: ubuntu-latest | |
needs: test | |
if: github.repository == 'rtimush/sbt-updates' && ( github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') ) | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.sbt | |
~/.cache/coursier/v1 | |
~/.ivy2/cache | |
key: ${{ runner.os }}-publish-cache-${{ hashFiles('*.sbt') }}-${{ hashFiles('project/*') }} | |
- uses: crazy-max/ghaction-import-gpg@v6.1.0 | |
with: | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }} | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: "8" | |
distribution: zulu | |
- run: sbt publishSigned | |
env: | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
- if: startsWith(github.ref, 'refs/tags/') | |
run: sbt sonatypeBundleRelease | |
env: | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} |