diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a7a5fa5 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,23 @@ +name: Release +on: + push: + branches: [main] + tags: ["*"] +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 8 + cache: sbt + - run: sbt ci-release + env: + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} + PGP_SECRET: ${{ secrets.PGP_SECRET }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 85e57fe..955d041 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -1,14 +1,14 @@ -name: Test and publish +name: Test on: pull_request: push: - branches: [ main ] - tags: [ v* ] + branches: + - main jobs: - compile-and-test: - name: Compile and test and publish + test: + name: test runs-on: ubuntu-latest strategy: fail-fast: false @@ -36,33 +36,5 @@ jobs: - name: Cache Coursier cache uses: coursier/cache-action@v6 - - name: Compile and test on JDK ${{matrix.java}}, Scala ${{matrix.scala}} + - name: Test on JDK ${{matrix.java}}, Scala ${{matrix.scala}} run: sbt ++${{matrix.scala}} test - - publish: - name: Publish to Maven Central - if: startsWith(github.ref, 'refs/tags/v') - needs: [ compile-and-test ] - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up JDK 8 - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: 8 - - - name: Cache Coursier cache - uses: coursier/cache-action@v6 - - - name: Publish - run: sbt ci-release - env: - PGP_SECRET: ${{ secrets.PGP_SECRET }} - SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} - SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}