|
| 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: ['**', '!update/**', '!pr/**'] |
| 13 | + push: |
| 14 | + branches: ['**', '!update/**', '!pr/**'] |
| 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.12.17, 2.13.10, 3.2.1] |
| 32 | + java: [temurin@11] |
| 33 | + project: [rootJS, rootJVM, rootNative] |
| 34 | + exclude: |
| 35 | + - scala: 3.2.1 |
| 36 | + project: rootJVM |
| 37 | + runs-on: ${{ matrix.os }} |
| 38 | + steps: |
| 39 | + - name: Checkout current branch (full) |
| 40 | + uses: actions/checkout@v2 |
| 41 | + with: |
| 42 | + fetch-depth: 0 |
| 43 | + |
| 44 | + - name: Download Java (temurin@11) |
| 45 | + id: download-java-temurin-11 |
| 46 | + if: matrix.java == 'temurin@11' |
| 47 | + uses: typelevel/download-java@v1 |
| 48 | + with: |
| 49 | + distribution: temurin |
| 50 | + java-version: 11 |
| 51 | + |
| 52 | + - name: Setup Java (temurin@11) |
| 53 | + if: matrix.java == 'temurin@11' |
| 54 | + uses: actions/setup-java@v2 |
| 55 | + with: |
| 56 | + distribution: jdkfile |
| 57 | + java-version: 11 |
| 58 | + jdkFile: ${{ steps.download-java-temurin-11.outputs.jdkFile }} |
| 59 | + |
| 60 | + - name: Cache sbt |
| 61 | + uses: actions/cache@v2 |
| 62 | + with: |
| 63 | + path: | |
| 64 | + ~/.sbt |
| 65 | + ~/.ivy2/cache |
| 66 | + ~/.coursier/cache/v1 |
| 67 | + ~/.cache/coursier/v1 |
| 68 | + ~/AppData/Local/Coursier/Cache/v1 |
| 69 | + ~/Library/Caches/Coursier/v1 |
| 70 | + key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} |
| 71 | + |
| 72 | + - name: Check that workflows are up to date |
| 73 | + run: sbt githubWorkflowCheck |
| 74 | + |
| 75 | + - name: Check formatting |
| 76 | + if: matrix.java == 'temurin@11' |
| 77 | + run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' scalafmtCheckAll 'project /' scalafmtSbtCheck |
| 78 | + |
| 79 | + - name: scalaJSLink |
| 80 | + if: matrix.project == 'rootJS' |
| 81 | + run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' Test/scalaJSLinkerResult |
| 82 | + |
| 83 | + - name: nativeLink |
| 84 | + if: matrix.project == 'rootNative' |
| 85 | + run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' Test/nativeLink |
| 86 | + |
| 87 | + - name: Test |
| 88 | + run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' test |
| 89 | + |
| 90 | + - name: Check binary compatibility |
| 91 | + if: matrix.java == 'temurin@11' |
| 92 | + run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' mimaReportBinaryIssues |
| 93 | + |
| 94 | + - name: Generate API documentation |
| 95 | + if: matrix.java == 'temurin@11' |
| 96 | + run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' doc |
| 97 | + |
| 98 | + - name: Make target directories |
| 99 | + if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master') |
| 100 | + run: mkdir -p target .js/target core/native/target tzdb/js/target core/js/target core/jvm/target tests/js/target .jvm/target .native/target demo/jvm/target tests/jvm/target demo/native/target tzdb/jvm/target tzdb/native/target tests/native/target demo/js/target project/target |
| 101 | + |
| 102 | + - name: Compress target directories |
| 103 | + if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master') |
| 104 | + run: tar cf targets.tar target .js/target core/native/target tzdb/js/target core/js/target core/jvm/target tests/js/target .jvm/target .native/target demo/jvm/target tests/jvm/target demo/native/target tzdb/jvm/target tzdb/native/target tests/native/target demo/js/target project/target |
| 105 | + |
| 106 | + - name: Upload target directories |
| 107 | + if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master') |
| 108 | + uses: actions/upload-artifact@v2 |
| 109 | + with: |
| 110 | + name: target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }}-${{ matrix.project }} |
| 111 | + path: targets.tar |
| 112 | + |
| 113 | + publish: |
| 114 | + name: Publish Artifacts |
| 115 | + needs: [build] |
| 116 | + if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master') |
| 117 | + strategy: |
| 118 | + matrix: |
| 119 | + os: [ubuntu-latest] |
| 120 | + scala: [2.13.10] |
| 121 | + java: [temurin@11] |
| 122 | + runs-on: ${{ matrix.os }} |
| 123 | + steps: |
| 124 | + - name: Checkout current branch (full) |
| 125 | + uses: actions/checkout@v2 |
| 126 | + with: |
| 127 | + fetch-depth: 0 |
| 128 | + |
| 129 | + - name: Download Java (temurin@11) |
| 130 | + id: download-java-temurin-11 |
| 131 | + if: matrix.java == 'temurin@11' |
| 132 | + uses: typelevel/download-java@v1 |
| 133 | + with: |
| 134 | + distribution: temurin |
| 135 | + java-version: 11 |
| 136 | + |
| 137 | + - name: Setup Java (temurin@11) |
| 138 | + if: matrix.java == 'temurin@11' |
| 139 | + uses: actions/setup-java@v2 |
| 140 | + with: |
| 141 | + distribution: jdkfile |
| 142 | + java-version: 11 |
| 143 | + jdkFile: ${{ steps.download-java-temurin-11.outputs.jdkFile }} |
| 144 | + |
| 145 | + - name: Cache sbt |
| 146 | + uses: actions/cache@v2 |
| 147 | + with: |
| 148 | + path: | |
| 149 | + ~/.sbt |
| 150 | + ~/.ivy2/cache |
| 151 | + ~/.coursier/cache/v1 |
| 152 | + ~/.cache/coursier/v1 |
| 153 | + ~/AppData/Local/Coursier/Cache/v1 |
| 154 | + ~/Library/Caches/Coursier/v1 |
| 155 | + key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} |
| 156 | + |
| 157 | + - name: Download target directories (2.12.17, rootJS) |
| 158 | + uses: actions/download-artifact@v2 |
| 159 | + with: |
| 160 | + name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.17-rootJS |
| 161 | + |
| 162 | + - name: Inflate target directories (2.12.17, rootJS) |
| 163 | + run: | |
| 164 | + tar xf targets.tar |
| 165 | + rm targets.tar |
| 166 | +
|
| 167 | + - name: Download target directories (2.12.17, rootJVM) |
| 168 | + uses: actions/download-artifact@v2 |
| 169 | + with: |
| 170 | + name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.17-rootJVM |
| 171 | + |
| 172 | + - name: Inflate target directories (2.12.17, rootJVM) |
| 173 | + run: | |
| 174 | + tar xf targets.tar |
| 175 | + rm targets.tar |
| 176 | +
|
| 177 | + - name: Download target directories (2.12.17, rootNative) |
| 178 | + uses: actions/download-artifact@v2 |
| 179 | + with: |
| 180 | + name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.17-rootNative |
| 181 | + |
| 182 | + - name: Inflate target directories (2.12.17, rootNative) |
| 183 | + run: | |
| 184 | + tar xf targets.tar |
| 185 | + rm targets.tar |
| 186 | +
|
| 187 | + - name: Download target directories (2.13.10, rootJS) |
| 188 | + uses: actions/download-artifact@v2 |
| 189 | + with: |
| 190 | + name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.10-rootJS |
| 191 | + |
| 192 | + - name: Inflate target directories (2.13.10, rootJS) |
| 193 | + run: | |
| 194 | + tar xf targets.tar |
| 195 | + rm targets.tar |
| 196 | +
|
| 197 | + - name: Download target directories (2.13.10, rootJVM) |
| 198 | + uses: actions/download-artifact@v2 |
| 199 | + with: |
| 200 | + name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.10-rootJVM |
| 201 | + |
| 202 | + - name: Inflate target directories (2.13.10, rootJVM) |
| 203 | + run: | |
| 204 | + tar xf targets.tar |
| 205 | + rm targets.tar |
| 206 | +
|
| 207 | + - name: Download target directories (2.13.10, rootNative) |
| 208 | + uses: actions/download-artifact@v2 |
| 209 | + with: |
| 210 | + name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.10-rootNative |
| 211 | + |
| 212 | + - name: Inflate target directories (2.13.10, rootNative) |
| 213 | + run: | |
| 214 | + tar xf targets.tar |
| 215 | + rm targets.tar |
| 216 | +
|
| 217 | + - name: Download target directories (3.2.1, rootJS) |
| 218 | + uses: actions/download-artifact@v2 |
| 219 | + with: |
| 220 | + name: target-${{ matrix.os }}-${{ matrix.java }}-3.2.1-rootJS |
| 221 | + |
| 222 | + - name: Inflate target directories (3.2.1, rootJS) |
| 223 | + run: | |
| 224 | + tar xf targets.tar |
| 225 | + rm targets.tar |
| 226 | +
|
| 227 | + - name: Download target directories (3.2.1, rootNative) |
| 228 | + uses: actions/download-artifact@v2 |
| 229 | + with: |
| 230 | + name: target-${{ matrix.os }}-${{ matrix.java }}-3.2.1-rootNative |
| 231 | + |
| 232 | + - name: Inflate target directories (3.2.1, rootNative) |
| 233 | + run: | |
| 234 | + tar xf targets.tar |
| 235 | + rm targets.tar |
| 236 | +
|
| 237 | + - name: Import signing key |
| 238 | + if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == '' |
| 239 | + run: echo $PGP_SECRET | base64 -di | gpg --import |
| 240 | + |
| 241 | + - name: Import signing key and strip passphrase |
| 242 | + if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE != '' |
| 243 | + run: | |
| 244 | + echo "$PGP_SECRET" | base64 -di > /tmp/signing-key.gpg |
| 245 | + echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg |
| 246 | + (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) |
| 247 | +
|
| 248 | + - name: Publish |
| 249 | + run: sbt '++ ${{ matrix.scala }}' tlRelease |
0 commit comments