format build.sbt #4
This file contains hidden or 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: [v*] | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && github.run_id || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: coursier/cache-action@v6 | |
| - uses: VirtusLab/scala-cli-setup@main | |
| with: | |
| jvm: temurin:21 | |
| apps: sbt | |
| power: true | |
| - run: sbt +Test/compile | |
| publish: | |
| runs-on: ubuntu-latest | |
| name: Publish Artifacts | |
| needs: [test] | |
| if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master') | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: coursier/cache-action@v6 | |
| - uses: VirtusLab/scala-cli-setup@main | |
| with: | |
| jvm: temurin:21 | |
| apps: sbt | |
| - name: Import signing key | |
| if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == '' | |
| env: | |
| PGP_SECRET: ${{ secrets.PGP_SECRET }} | |
| PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} | |
| run: echo $PGP_SECRET | base64 -d -i - | gpg --import | |
| - name: Import signing key and strip passphrase | |
| if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE != '' | |
| env: | |
| PGP_SECRET: ${{ secrets.PGP_SECRET }} | |
| PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} | |
| run: | | |
| echo "$PGP_SECRET" | base64 -d -i - > /tmp/signing-key.gpg | |
| echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg | |
| (echo "$PGP_PASSPHRASE"; echo; echo) | gpg --command-fd 0 --pinentry-mode loopback --change-passphrase $(gpg --list-secret-keys --with-colons 2> /dev/null | grep '^sec:' | cut --delimiter ':' --fields 5 | tail -n 1) | |
| - name: Publish | |
| env: | |
| SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
| SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
| run: sbt +publishSigned +sonatypeCentralRelease |