From 0747425bd12b23b4a9afd43dbf8e52aa9778f980 Mon Sep 17 00:00:00 2001 From: satorg Date: Mon, 29 Aug 2022 01:53:40 -0700 Subject: [PATCH] sbt githubWorkflowGenerate --- .github/workflows/ci.yml | 177 ++++++++++++++++++++++++++++----------- 1 file changed, 130 insertions(+), 47 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ae42cbe827..b115779755a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,11 +15,6 @@ on: tags: [v*] env: - PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} - SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} - SONATYPE_CREDENTIAL_HOST: ${{ secrets.SONATYPE_CREDENTIAL_HOST }} - SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} - PGP_SECRET: ${{ secrets.PGP_SECRET }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: @@ -51,21 +46,21 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Download Java (temurin@8) id: download-java-temurin-8 if: matrix.java == 'temurin@8' - uses: typelevel/download-java@v1 + uses: typelevel/download-java@v2 with: distribution: temurin java-version: 8 - name: Setup Java (temurin@8) if: matrix.java == 'temurin@8' - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: jdkfile java-version: 8 @@ -74,14 +69,14 @@ jobs: - name: Download Java (temurin@17) id: download-java-temurin-17 if: matrix.java == 'temurin@17' - uses: typelevel/download-java@v1 + uses: typelevel/download-java@v2 with: distribution: temurin java-version: 17 - name: Setup Java (temurin@17) if: matrix.java == 'temurin@17' - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: jdkfile java-version: 17 @@ -90,21 +85,21 @@ jobs: - name: Download Java (graalvm@11) id: download-java-graalvm-11 if: matrix.java == 'graalvm@11' - uses: typelevel/download-java@v1 + uses: typelevel/download-java@v2 with: distribution: graalvm java-version: 11 - name: Setup Java (graalvm@11) if: matrix.java == 'graalvm@11' - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: jdkfile java-version: 11 jdkFile: ${{ steps.download-java-graalvm-11.outputs.jdkFile }} - name: Cache sbt - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | ~/.sbt @@ -151,7 +146,7 @@ jobs: - name: Upload target directories if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }}-${{ matrix.project }} path: targets.tar @@ -168,21 +163,21 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Download Java (temurin@8) id: download-java-temurin-8 if: matrix.java == 'temurin@8' - uses: typelevel/download-java@v1 + uses: typelevel/download-java@v2 with: distribution: temurin java-version: 8 - name: Setup Java (temurin@8) if: matrix.java == 'temurin@8' - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: jdkfile java-version: 8 @@ -191,14 +186,14 @@ jobs: - name: Download Java (temurin@17) id: download-java-temurin-17 if: matrix.java == 'temurin@17' - uses: typelevel/download-java@v1 + uses: typelevel/download-java@v2 with: distribution: temurin java-version: 17 - name: Setup Java (temurin@17) if: matrix.java == 'temurin@17' - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: jdkfile java-version: 17 @@ -207,21 +202,21 @@ jobs: - name: Download Java (graalvm@11) id: download-java-graalvm-11 if: matrix.java == 'graalvm@11' - uses: typelevel/download-java@v1 + uses: typelevel/download-java@v2 with: distribution: graalvm java-version: 11 - name: Setup Java (graalvm@11) if: matrix.java == 'graalvm@11' - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: jdkfile java-version: 11 jdkFile: ${{ steps.download-java-graalvm-11.outputs.jdkFile }} - name: Cache sbt - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | ~/.sbt @@ -233,7 +228,7 @@ jobs: key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - name: Download target directories (2.12.16, rootJS) - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.16-rootJS @@ -243,7 +238,7 @@ jobs: rm targets.tar - name: Download target directories (2.12.16, rootJVM) - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.16-rootJVM @@ -253,7 +248,7 @@ jobs: rm targets.tar - name: Download target directories (2.12.16, rootNative) - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.16-rootNative @@ -263,7 +258,7 @@ jobs: rm targets.tar - name: Download target directories (2.13.8, rootJS) - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.8-rootJS @@ -273,7 +268,7 @@ jobs: rm targets.tar - name: Download target directories (2.13.8, rootJVM) - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.8-rootJVM @@ -283,7 +278,7 @@ jobs: rm targets.tar - name: Download target directories (2.13.8, rootNative) - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.8-rootNative @@ -293,7 +288,7 @@ jobs: rm targets.tar - name: Download target directories (3.1.3, rootJS) - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.3-rootJS @@ -303,7 +298,7 @@ jobs: rm targets.tar - name: Download target directories (3.1.3, rootJVM) - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.3-rootJVM @@ -313,7 +308,7 @@ jobs: rm targets.tar - name: Download target directories (3.1.3, rootNative) - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.3-rootNative @@ -324,18 +319,106 @@ jobs: - 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 -di | 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 -di > /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 }} + SONATYPE_CREDENTIAL_HOST: ${{ secrets.SONATYPE_CREDENTIAL_HOST }} run: sbt '++${{ matrix.scala }}' tlRelease + dependency-submission: + name: Submit Dependencies + if: github.event_name != 'pull_request' + strategy: + matrix: + os: [ubuntu-latest] + scala: [2.13.8] + java: [temurin@8] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout current branch (full) + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Download Java (temurin@8) + id: download-java-temurin-8 + if: matrix.java == 'temurin@8' + uses: typelevel/download-java@v2 + with: + distribution: temurin + java-version: 8 + + - name: Setup Java (temurin@8) + if: matrix.java == 'temurin@8' + uses: actions/setup-java@v3 + with: + distribution: jdkfile + java-version: 8 + jdkFile: ${{ steps.download-java-temurin-8.outputs.jdkFile }} + + - name: Download Java (temurin@17) + id: download-java-temurin-17 + if: matrix.java == 'temurin@17' + uses: typelevel/download-java@v2 + with: + distribution: temurin + java-version: 17 + + - name: Setup Java (temurin@17) + if: matrix.java == 'temurin@17' + uses: actions/setup-java@v3 + with: + distribution: jdkfile + java-version: 17 + jdkFile: ${{ steps.download-java-temurin-17.outputs.jdkFile }} + + - name: Download Java (graalvm@11) + id: download-java-graalvm-11 + if: matrix.java == 'graalvm@11' + uses: typelevel/download-java@v2 + with: + distribution: graalvm + java-version: 11 + + - name: Setup Java (graalvm@11) + if: matrix.java == 'graalvm@11' + uses: actions/setup-java@v3 + with: + distribution: jdkfile + java-version: 11 + jdkFile: ${{ steps.download-java-graalvm-11.outputs.jdkFile }} + + - name: Cache sbt + uses: actions/cache@v3 + with: + path: | + ~/.sbt + ~/.ivy2/cache + ~/.coursier/cache/v1 + ~/.cache/coursier/v1 + ~/AppData/Local/Coursier/Cache/v1 + ~/Library/Caches/Coursier/v1 + key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + + - name: Submit Dependencies + uses: scalacenter/sbt-dependency-submission@v2 + scalafix: name: Scalafix strategy: @@ -346,21 +429,21 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Download Java (temurin@8) id: download-java-temurin-8 if: matrix.java == 'temurin@8' - uses: typelevel/download-java@v1 + uses: typelevel/download-java@v2 with: distribution: temurin java-version: 8 - name: Setup Java (temurin@8) if: matrix.java == 'temurin@8' - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: jdkfile java-version: 8 @@ -369,14 +452,14 @@ jobs: - name: Download Java (temurin@17) id: download-java-temurin-17 if: matrix.java == 'temurin@17' - uses: typelevel/download-java@v1 + uses: typelevel/download-java@v2 with: distribution: temurin java-version: 17 - name: Setup Java (temurin@17) if: matrix.java == 'temurin@17' - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: jdkfile java-version: 17 @@ -385,21 +468,21 @@ jobs: - name: Download Java (graalvm@11) id: download-java-graalvm-11 if: matrix.java == 'graalvm@11' - uses: typelevel/download-java@v1 + uses: typelevel/download-java@v2 with: distribution: graalvm java-version: 11 - name: Setup Java (graalvm@11) if: matrix.java == 'graalvm@11' - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: jdkfile java-version: 11 jdkFile: ${{ steps.download-java-graalvm-11.outputs.jdkFile }} - name: Cache sbt - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | ~/.sbt @@ -425,21 +508,21 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Download Java (temurin@8) id: download-java-temurin-8 if: matrix.java == 'temurin@8' - uses: typelevel/download-java@v1 + uses: typelevel/download-java@v2 with: distribution: temurin java-version: 8 - name: Setup Java (temurin@8) if: matrix.java == 'temurin@8' - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: jdkfile java-version: 8 @@ -448,14 +531,14 @@ jobs: - name: Download Java (temurin@17) id: download-java-temurin-17 if: matrix.java == 'temurin@17' - uses: typelevel/download-java@v1 + uses: typelevel/download-java@v2 with: distribution: temurin java-version: 17 - name: Setup Java (temurin@17) if: matrix.java == 'temurin@17' - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: jdkfile java-version: 17 @@ -464,21 +547,21 @@ jobs: - name: Download Java (graalvm@11) id: download-java-graalvm-11 if: matrix.java == 'graalvm@11' - uses: typelevel/download-java@v1 + uses: typelevel/download-java@v2 with: distribution: graalvm java-version: 11 - name: Setup Java (graalvm@11) if: matrix.java == 'graalvm@11' - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: jdkfile java-version: 11 jdkFile: ${{ steps.download-java-graalvm-11.outputs.jdkFile }} - name: Cache sbt - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | ~/.sbt