|
36 | 36 | core: false |
37 | 37 | cask: true |
38 | 38 |
|
39 | | - - name: Update data for homebrew/cask |
40 | | - run: /usr/bin/rake casks |
| 39 | + - run: brew generate-cask-api |
41 | 40 | env: |
42 | 41 | HOMEBREW_DEVELOPER: 1 |
43 | 42 |
|
|
72 | 71 | core: true |
73 | 72 | cask: false |
74 | 73 |
|
75 | | - - name: Update data for homebrew/core |
76 | | - run: /usr/bin/rake formulae |
| 74 | + - run: brew generate-formula-api |
77 | 75 | env: |
78 | 76 | HOMEBREW_DEVELOPER: 1 |
79 | 77 |
|
@@ -126,8 +124,36 @@ jobs: |
126 | 124 | - name: Create directories |
127 | 125 | run: mkdir -p _data/analytics api/analytics |
128 | 126 |
|
| 127 | + - name: Determine analytics cache date |
| 128 | + id: analytics-cache-date |
| 129 | + run: echo "date=$(date -u +%Y-%m-%d)" >> "$GITHUB_OUTPUT" |
| 130 | + |
| 131 | + - name: Cache analytics data |
| 132 | + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 |
| 133 | + with: |
| 134 | + path: | |
| 135 | + _data/analytics |
| 136 | + api/analytics |
| 137 | + key: analytics-data-${{ steps.analytics-cache-date.outputs.date }} |
| 138 | + restore-keys: analytics-data- |
| 139 | + |
129 | 140 | - name: Update analytics data |
130 | | - run: /usr/bin/rake analytics |
| 141 | + run: | |
| 142 | + set -euo pipefail |
| 143 | +
|
| 144 | + analytics_backup_path="$(mktemp -d)" |
| 145 | + mv -v "_data/analytics" "${analytics_backup_path}/data_analytics" |
| 146 | + mv -v "api/analytics" "${analytics_backup_path}/api_analytics" |
| 147 | +
|
| 148 | + if brew generate-analytics-api; then |
| 149 | + exit 0 |
| 150 | + fi |
| 151 | +
|
| 152 | + rm -rf "_data/analytics" "api/analytics" |
| 153 | + mv -v "${analytics_backup_path}/data_analytics" "_data/analytics" |
| 154 | + mv -v "${analytics_backup_path}/api_analytics" "api/analytics" |
| 155 | +
|
| 156 | + echo "::notice title=Analytics fallback::Restored cached analytics data after brew generate-analytics-api failure." |
131 | 157 | if: github.ref_name == 'main' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false && github.event.pull_request.user.login != 'dependabot[bot]') |
132 | 158 | env: |
133 | 159 | HOMEBREW_INFLUXDB_TOKEN: ${{ secrets.HOMEBREW_INFLUXDB_READ_TOKEN }} |
@@ -183,9 +209,9 @@ jobs: |
183 | 209 | run: | |
184 | 210 | GENERATE_SAMPLES="${{ github.ref_name == 'main' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false && github.event.pull_request.user.login != 'dependabot[bot]') }}" |
185 | 211 | if [ "$GENERATE_SAMPLES" = "true" ]; then |
186 | | - /usr/bin/rake "api_samples" |
| 212 | + ruby script/generate-api-samples.rb |
187 | 213 | else |
188 | | - /usr/bin/rake "api_samples[template]" |
| 214 | + ruby script/generate-api-samples.rb --template |
189 | 215 | fi |
190 | 216 |
|
191 | 217 | - name: Build site |
@@ -224,14 +250,7 @@ jobs: |
224 | 250 |
|
225 | 251 | deploy-issue: |
226 | 252 | name: Open/close deploy issues |
227 | | - needs: |
228 | | - [ |
229 | | - generate-cask, |
230 | | - generate-core, |
231 | | - generate-analytics, |
232 | | - build, |
233 | | - deploy, |
234 | | - ] |
| 253 | + needs: [generate-cask, generate-core, generate-analytics, build, deploy] |
235 | 254 | if: ${{ always() && github.ref_name == 'main' }} |
236 | 255 | env: |
237 | 256 | RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} |
|
0 commit comments