|
62 | 62 | # we specify bash to get pipefail; it guards against the `curl` command
|
63 | 63 | # failing. otherwise `sh` won't catch that `curl` returned non-0
|
64 | 64 | shell: bash
|
65 |
| - run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.9.0/cargo-dist-installer.sh | sh" |
| 65 | + run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.11.1/cargo-dist-installer.sh | sh" |
66 | 66 | # sure would be cool if github gave us proper conditionals...
|
67 | 67 | # so here's a doubly-nested ternary-via-truthiness to try to provide the best possible
|
68 | 68 | # functionality based on whether this is a pull_request, and whether it's from a fork.
|
@@ -161,7 +161,8 @@ jobs:
|
161 | 161 | with:
|
162 | 162 | submodules: recursive
|
163 | 163 | - name: Install cargo-dist
|
164 |
| - run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.9.0/cargo-dist-installer.sh | sh" |
| 164 | + shell: bash |
| 165 | + run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.11.1/cargo-dist-installer.sh | sh" |
165 | 166 | # Get all the local artifacts for the global tasks to use (for e.g. checksums)
|
166 | 167 | - name: Fetch local artifacts
|
167 | 168 | uses: actions/download-artifact@v4
|
@@ -216,7 +217,7 @@ jobs:
|
216 | 217 | with:
|
217 | 218 | submodules: recursive
|
218 | 219 | - name: Install cargo-dist
|
219 |
| - run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.9.0/cargo-dist-installer.sh | sh" |
| 220 | + run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.11.1/cargo-dist-installer.sh | sh" |
220 | 221 | # Fetch artifacts from scratch-storage
|
221 | 222 | - name: Fetch artifacts
|
222 | 223 | uses: actions/download-artifact@v4
|
@@ -262,16 +263,19 @@ jobs:
|
262 | 263 | pattern: artifacts-*
|
263 | 264 | path: Formula/
|
264 | 265 | merge-multiple: true
|
| 266 | + # This is extra complex because you can make your Formula name not match your app name |
| 267 | + # so we need to find releases with a *.rb file, and publish with that filename. |
265 | 268 | - name: Commit formula files
|
266 | 269 | run: |
|
267 | 270 | git config --global user.name "${GITHUB_USER}"
|
268 | 271 | git config --global user.email "${GITHUB_EMAIL}"
|
269 | 272 |
|
270 |
| - for release in $(echo "$PLAN" | jq --compact-output '.releases[]'); do |
271 |
| - name=$(echo "$release" | jq .app_name --raw-output) |
| 273 | + for release in $(echo "$PLAN" | jq --compact-output '.releases[] | select([.artifacts[] | endswith(".rb")] | any)'); do |
| 274 | + filename=$(echo "$release" | jq '.artifacts[] | select(endswith(".rb"))' --raw-output) |
| 275 | + name=$(echo "$filename" | sed "s/\.rb$//") |
272 | 276 | version=$(echo "$release" | jq .app_version --raw-output)
|
273 | 277 |
|
274 |
| - git add Formula/${name}.rb |
| 278 | + git add "Formula/${filename}" |
275 | 279 | git commit -m "${name} ${version}"
|
276 | 280 | done
|
277 | 281 | git push
|
|
0 commit comments