|
| 1 | +# This file was automatically generated by sbt-github-actions using the |
| 2 | +# githubWorkflowGenerate task. You should add and commit this file to |
| 3 | +# your git repository. It goes without saying that you shouldn't edit |
| 4 | +# this file by hand! Instead, if you wish to make changes, you should |
| 5 | +# change your sbt build configuration to revise the workflow description |
| 6 | +# to meet your needs, then regenerate this file. |
| 7 | + |
| 8 | +name: Continuous Integration |
| 9 | + |
| 10 | +on: |
| 11 | + pull_request: |
| 12 | + branches: ['**'] |
| 13 | + push: |
| 14 | + branches: ['**'] |
| 15 | + tags: [v*] |
| 16 | + |
| 17 | +env: |
| 18 | + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} |
| 19 | + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} |
| 20 | + SONATYPE_CREDENTIAL_HOST: ${{ secrets.SONATYPE_CREDENTIAL_HOST }} |
| 21 | + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} |
| 22 | + PGP_SECRET: ${{ secrets.PGP_SECRET }} |
| 23 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 24 | + |
| 25 | +jobs: |
| 26 | + build: |
| 27 | + name: Build and Test |
| 28 | + strategy: |
| 29 | + matrix: |
| 30 | + os: [ubuntu-latest] |
| 31 | + scala: [2.13.7, 3.1.3] |
| 32 | + java: [temurin@8] |
| 33 | + project: [rootJVM] |
| 34 | + runs-on: ${{ matrix.os }} |
| 35 | + steps: |
| 36 | + - name: Checkout current branch (full) |
| 37 | + uses: actions/checkout@v2 |
| 38 | + with: |
| 39 | + fetch-depth: 0 |
| 40 | + |
| 41 | + - name: Download Java (temurin@8) |
| 42 | + id: download-java-temurin-8 |
| 43 | + if: matrix.java == 'temurin@8' |
| 44 | + uses: typelevel/download-java@v1 |
| 45 | + with: |
| 46 | + distribution: temurin |
| 47 | + java-version: 8 |
| 48 | + |
| 49 | + - name: Setup Java (temurin@8) |
| 50 | + if: matrix.java == 'temurin@8' |
| 51 | + uses: actions/setup-java@v2 |
| 52 | + with: |
| 53 | + distribution: jdkfile |
| 54 | + java-version: 8 |
| 55 | + jdkFile: ${{ steps.download-java-temurin-8.outputs.jdkFile }} |
| 56 | + |
| 57 | + - name: Cache sbt |
| 58 | + uses: actions/cache@v2 |
| 59 | + with: |
| 60 | + path: | |
| 61 | + ~/.sbt |
| 62 | + ~/.ivy2/cache |
| 63 | + ~/.coursier/cache/v1 |
| 64 | + ~/.cache/coursier/v1 |
| 65 | + ~/AppData/Local/Coursier/Cache/v1 |
| 66 | + ~/Library/Caches/Coursier/v1 |
| 67 | + key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} |
| 68 | + |
| 69 | + - name: Check that workflows are up to date |
| 70 | + run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' 'project /' githubWorkflowCheck |
| 71 | + |
| 72 | + - name: Test |
| 73 | + run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' test |
| 74 | + |
| 75 | + - name: Check binary compatibility |
| 76 | + if: matrix.java == 'temurin@8' |
| 77 | + run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' mimaReportBinaryIssues |
| 78 | + |
| 79 | + - name: Generate API documentation |
| 80 | + if: matrix.java == 'temurin@8' |
| 81 | + run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' doc |
| 82 | + |
| 83 | + - name: Make target directories |
| 84 | + if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') |
| 85 | + run: mkdir -p target .js/target site/target .jvm/target .native/target equilibrium/target core/target project/target |
| 86 | + |
| 87 | + - name: Compress target directories |
| 88 | + if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') |
| 89 | + run: tar cf targets.tar target .js/target site/target .jvm/target .native/target equilibrium/target core/target project/target |
| 90 | + |
| 91 | + - name: Upload target directories |
| 92 | + if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') |
| 93 | + uses: actions/upload-artifact@v2 |
| 94 | + with: |
| 95 | + name: target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }}-${{ matrix.project }} |
| 96 | + path: targets.tar |
| 97 | + |
| 98 | + publish: |
| 99 | + name: Publish Artifacts |
| 100 | + needs: [build] |
| 101 | + if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') |
| 102 | + strategy: |
| 103 | + matrix: |
| 104 | + os: [ubuntu-latest] |
| 105 | + scala: [2.13.7] |
| 106 | + java: [temurin@8] |
| 107 | + runs-on: ${{ matrix.os }} |
| 108 | + steps: |
| 109 | + - name: Checkout current branch (full) |
| 110 | + uses: actions/checkout@v2 |
| 111 | + with: |
| 112 | + fetch-depth: 0 |
| 113 | + |
| 114 | + - name: Download Java (temurin@8) |
| 115 | + id: download-java-temurin-8 |
| 116 | + if: matrix.java == 'temurin@8' |
| 117 | + uses: typelevel/download-java@v1 |
| 118 | + with: |
| 119 | + distribution: temurin |
| 120 | + java-version: 8 |
| 121 | + |
| 122 | + - name: Setup Java (temurin@8) |
| 123 | + if: matrix.java == 'temurin@8' |
| 124 | + uses: actions/setup-java@v2 |
| 125 | + with: |
| 126 | + distribution: jdkfile |
| 127 | + java-version: 8 |
| 128 | + jdkFile: ${{ steps.download-java-temurin-8.outputs.jdkFile }} |
| 129 | + |
| 130 | + - name: Cache sbt |
| 131 | + uses: actions/cache@v2 |
| 132 | + with: |
| 133 | + path: | |
| 134 | + ~/.sbt |
| 135 | + ~/.ivy2/cache |
| 136 | + ~/.coursier/cache/v1 |
| 137 | + ~/.cache/coursier/v1 |
| 138 | + ~/AppData/Local/Coursier/Cache/v1 |
| 139 | + ~/Library/Caches/Coursier/v1 |
| 140 | + key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} |
| 141 | + |
| 142 | + - name: Download target directories (2.13.7, rootJVM) |
| 143 | + uses: actions/download-artifact@v2 |
| 144 | + with: |
| 145 | + name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.7-rootJVM |
| 146 | + |
| 147 | + - name: Inflate target directories (2.13.7, rootJVM) |
| 148 | + run: | |
| 149 | + tar xf targets.tar |
| 150 | + rm targets.tar |
| 151 | +
|
| 152 | + - name: Download target directories (3.1.3, rootJVM) |
| 153 | + uses: actions/download-artifact@v2 |
| 154 | + with: |
| 155 | + name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.3-rootJVM |
| 156 | + |
| 157 | + - name: Inflate target directories (3.1.3, rootJVM) |
| 158 | + run: | |
| 159 | + tar xf targets.tar |
| 160 | + rm targets.tar |
| 161 | +
|
| 162 | + - name: Import signing key |
| 163 | + if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == '' |
| 164 | + run: echo $PGP_SECRET | base64 -di | gpg --import |
| 165 | + |
| 166 | + - name: Import signing key and strip passphrase |
| 167 | + if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE != '' |
| 168 | + run: | |
| 169 | + echo "$PGP_SECRET" | base64 -di > /tmp/signing-key.gpg |
| 170 | + echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg |
| 171 | + (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) |
| 172 | +
|
| 173 | + - name: Publish |
| 174 | + run: sbt '++${{ matrix.scala }}' tlRelease |
| 175 | + |
| 176 | + site: |
| 177 | + name: Generate Site |
| 178 | + strategy: |
| 179 | + matrix: |
| 180 | + os: [ubuntu-latest] |
| 181 | + scala: [2.13.7] |
| 182 | + java: [temurin@8] |
| 183 | + runs-on: ${{ matrix.os }} |
| 184 | + steps: |
| 185 | + - name: Checkout current branch (full) |
| 186 | + uses: actions/checkout@v2 |
| 187 | + with: |
| 188 | + fetch-depth: 0 |
| 189 | + |
| 190 | + - name: Download Java (temurin@8) |
| 191 | + id: download-java-temurin-8 |
| 192 | + if: matrix.java == 'temurin@8' |
| 193 | + uses: typelevel/download-java@v1 |
| 194 | + with: |
| 195 | + distribution: temurin |
| 196 | + java-version: 8 |
| 197 | + |
| 198 | + - name: Setup Java (temurin@8) |
| 199 | + if: matrix.java == 'temurin@8' |
| 200 | + uses: actions/setup-java@v2 |
| 201 | + with: |
| 202 | + distribution: jdkfile |
| 203 | + java-version: 8 |
| 204 | + jdkFile: ${{ steps.download-java-temurin-8.outputs.jdkFile }} |
| 205 | + |
| 206 | + - name: Cache sbt |
| 207 | + uses: actions/cache@v2 |
| 208 | + with: |
| 209 | + path: | |
| 210 | + ~/.sbt |
| 211 | + ~/.ivy2/cache |
| 212 | + ~/.coursier/cache/v1 |
| 213 | + ~/.cache/coursier/v1 |
| 214 | + ~/AppData/Local/Coursier/Cache/v1 |
| 215 | + ~/Library/Caches/Coursier/v1 |
| 216 | + key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} |
| 217 | + |
| 218 | + - name: Generate site |
| 219 | + run: sbt '++${{ matrix.scala }}' site/tlSite |
| 220 | + |
| 221 | + - name: Publish site |
| 222 | + if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' |
| 223 | + |
| 224 | + with: |
| 225 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 226 | + publish_dir: site/target/docs/site |
| 227 | + keep_files: true |
0 commit comments