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