|
15 | 15 | tags: [v*]
|
16 | 16 |
|
17 | 17 | env:
|
18 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
19 |
| - SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} |
| 18 | + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} |
20 | 19 | SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
|
| 20 | + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} |
21 | 21 | PGP_SECRET: ${{ secrets.PGP_SECRET }}
|
| 22 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
22 | 23 |
|
23 | 24 | jobs:
|
24 | 25 | build:
|
25 | 26 | name: Build and Test
|
26 | 27 | strategy:
|
| 28 | + fail-fast: false |
27 | 29 | matrix:
|
28 | 30 | os: [ubuntu-latest]
|
29 |
| - scala: [2.12.15, 3.1.0, 2.13.7] |
| 31 | + scala: [2.12.15, 3.1.1, 2.13.8] |
30 | 32 | java: [temurin@8]
|
| 33 | + browser: [Chrome, Firefox] |
| 34 | + exclude: |
| 35 | + - scala: 2.12.15 |
| 36 | + browser: Firefox |
| 37 | + - scala: 3.1.1 |
| 38 | + browser: Firefox |
31 | 39 | runs-on: ${{ matrix.os }}
|
32 | 40 | steps:
|
33 | 41 | - name: Checkout current branch (full)
|
@@ -55,27 +63,50 @@ jobs:
|
55 | 63 | key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
|
56 | 64 |
|
57 | 65 | - name: Check that workflows are up to date
|
58 |
| - run: sbt ++${{ matrix.scala }} githubWorkflowCheck |
| 66 | + run: 'sbt ''++${{ matrix.scala }}'' ''set Global / useJSEnv := JSEnv.${{ matrix.browser }}'' ''project /'' githubWorkflowCheck' |
| 67 | + |
| 68 | + - name: Check headers and formatting |
| 69 | + if: matrix.java == 'temurin@8' |
| 70 | + run: 'sbt ''++${{ matrix.scala }}'' ''set Global / useJSEnv := JSEnv.${{ matrix.browser }}'' headerCheckAll scalafmtCheckAll ''project /'' scalafmtSbtCheck' |
| 71 | + |
| 72 | + - name: Test |
| 73 | + run: 'sbt ''++${{ matrix.scala }}'' ''set Global / useJSEnv := JSEnv.${{ matrix.browser }}'' test' |
| 74 | + |
| 75 | + - name: Check binary compatibility |
| 76 | + if: matrix.java == 'temurin@8' |
| 77 | + run: 'sbt ''++${{ matrix.scala }}'' ''set Global / useJSEnv := JSEnv.${{ matrix.browser }}'' mimaReportBinaryIssues' |
| 78 | + |
| 79 | + - name: Generate API documentation |
| 80 | + if: matrix.java == 'temurin@8' |
| 81 | + run: 'sbt ''++${{ matrix.scala }}'' ''set Global / useJSEnv := JSEnv.${{ matrix.browser }}'' doc' |
| 82 | + |
| 83 | + - name: Check unused compile dependencies |
| 84 | + if: matrix.java == 'temurin@8' |
| 85 | + run: 'sbt ''++${{ matrix.scala }}'' ''set Global / useJSEnv := JSEnv.${{ matrix.browser }}'' unusedCompileDependenciesTest' |
59 | 86 |
|
60 |
| - - run: sbt ++${{ matrix.scala }} ci |
| 87 | + - name: Make target directories |
| 88 | + if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') |
| 89 | + run: mkdir -p target site/target tests/target dom/target jsdocs/target project/target |
61 | 90 |
|
62 | 91 | - name: Compress target directories
|
63 |
| - run: tar cf targets.tar target mdocs/target tests/target dom/target jsdocs/target project/target |
| 92 | + if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') |
| 93 | + run: tar cf targets.tar target site/target tests/target dom/target jsdocs/target project/target |
64 | 94 |
|
65 | 95 | - name: Upload target directories
|
| 96 | + if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') |
66 | 97 | uses: actions/upload-artifact@v2
|
67 | 98 | with:
|
68 |
| - name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }} |
| 99 | + name: target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }}-${{ matrix.browser }} |
69 | 100 | path: targets.tar
|
70 | 101 |
|
71 | 102 | publish:
|
72 | 103 | name: Publish Artifacts
|
73 | 104 | needs: [build]
|
74 |
| - if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v')) |
| 105 | + if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') |
75 | 106 | strategy:
|
76 | 107 | matrix:
|
77 | 108 | os: [ubuntu-latest]
|
78 |
| - scala: [2.13.7] |
| 109 | + scala: [2.13.8] |
79 | 110 | java: [temurin@8]
|
80 | 111 | runs-on: ${{ matrix.os }}
|
81 | 112 | steps:
|
@@ -103,37 +134,90 @@ jobs:
|
103 | 134 | ~/Library/Caches/Coursier/v1
|
104 | 135 | key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
|
105 | 136 |
|
106 |
| - - name: Download target directories (2.12.15) |
| 137 | + - name: Download target directories (2.12.15, Chrome) |
107 | 138 | uses: actions/download-artifact@v2
|
108 | 139 | with:
|
109 |
| - name: target-${{ matrix.os }}-2.12.15-${{ matrix.java }} |
| 140 | + name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.15-Chrome |
110 | 141 |
|
111 |
| - - name: Inflate target directories (2.12.15) |
| 142 | + - name: Inflate target directories (2.12.15, Chrome) |
112 | 143 | run: |
|
113 | 144 | tar xf targets.tar
|
114 | 145 | rm targets.tar
|
115 | 146 |
|
116 |
| - - name: Download target directories (3.1.0) |
| 147 | + - name: Download target directories (3.1.1, Chrome) |
117 | 148 | uses: actions/download-artifact@v2
|
118 | 149 | with:
|
119 |
| - name: target-${{ matrix.os }}-3.1.0-${{ matrix.java }} |
| 150 | + name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.1-Chrome |
120 | 151 |
|
121 |
| - - name: Inflate target directories (3.1.0) |
| 152 | + - name: Inflate target directories (3.1.1, Chrome) |
122 | 153 | run: |
|
123 | 154 | tar xf targets.tar
|
124 | 155 | rm targets.tar
|
125 | 156 |
|
126 |
| - - name: Download target directories (2.13.7) |
| 157 | + - name: Download target directories (2.13.8, Chrome) |
127 | 158 | uses: actions/download-artifact@v2
|
128 | 159 | with:
|
129 |
| - name: target-${{ matrix.os }}-2.13.7-${{ matrix.java }} |
| 160 | + name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.8-Chrome |
130 | 161 |
|
131 |
| - - name: Inflate target directories (2.13.7) |
| 162 | + - name: Inflate target directories (2.13.8, Chrome) |
132 | 163 | run: |
|
133 | 164 | tar xf targets.tar
|
134 | 165 | rm targets.tar
|
135 | 166 |
|
136 | 167 | - name: Import signing key
|
| 168 | + if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == '' |
137 | 169 | run: echo $PGP_SECRET | base64 -d | gpg --import
|
138 | 170 |
|
139 |
| - - run: sbt ++${{ matrix.scala }} release |
| 171 | + - name: Import signing key and strip passphrase |
| 172 | + if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE != '' |
| 173 | + run: | |
| 174 | + echo "$PGP_SECRET" | base64 -d > /tmp/signing-key.gpg |
| 175 | + echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg |
| 176 | + (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) |
| 177 | +
|
| 178 | + - name: Publish |
| 179 | + run: sbt '++${{ matrix.scala }}' tlRelease |
| 180 | + |
| 181 | + site: |
| 182 | + name: Generate Site |
| 183 | + strategy: |
| 184 | + matrix: |
| 185 | + os: [ubuntu-latest] |
| 186 | + scala: [2.13.8] |
| 187 | + java: [temurin@8] |
| 188 | + runs-on: ${{ matrix.os }} |
| 189 | + steps: |
| 190 | + - name: Checkout current branch (full) |
| 191 | + uses: actions/checkout@v2 |
| 192 | + with: |
| 193 | + fetch-depth: 0 |
| 194 | + |
| 195 | + - name: Setup Java (temurin@8) |
| 196 | + if: matrix.java == 'temurin@8' |
| 197 | + uses: actions/setup-java@v2 |
| 198 | + with: |
| 199 | + distribution: temurin |
| 200 | + java-version: 8 |
| 201 | + |
| 202 | + - name: Cache sbt |
| 203 | + uses: actions/cache@v2 |
| 204 | + with: |
| 205 | + path: | |
| 206 | + ~/.sbt |
| 207 | + ~/.ivy2/cache |
| 208 | + ~/.coursier/cache/v1 |
| 209 | + ~/.cache/coursier/v1 |
| 210 | + ~/AppData/Local/Coursier/Cache/v1 |
| 211 | + ~/Library/Caches/Coursier/v1 |
| 212 | + key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} |
| 213 | + |
| 214 | + - name: Generate site |
| 215 | + run: sbt '++${{ matrix.scala }}' docs/tlSite |
| 216 | + |
| 217 | + - name: Publish site |
| 218 | + if: github.event_name != 'pull_request' && github.ref == 'refs/heads/series/0.2' |
| 219 | + |
| 220 | + with: |
| 221 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 222 | + publish_dir: site/target/docs/site |
| 223 | + publish_branch: gh-pages |
0 commit comments