- Eliminated redundant checksum generation steps in release workflows. - Updated asset validation checks to exclude checksum files and focus solely on archive assets. - Simplified workflow logic for packaging and uploading release artifacts.
Showing the changes to .github (1 of 1 file). Show all
Unified · Split
| @@ -149,24 +149,6 @@ jobs: · 148 unmodified lines | ||
| 149 | 149 | else |
| 150 | 150 | tar -C "$archive_dir" -czf "dist/$archive_name" "$binary_name" LICENSE README.md README_CN.md config.example.yaml |
| 151 | 151 | fi |
| 152 | − - name: Create asset checksum | |
| 153 | − shell: bash | |
| 154 | − run: | | |
| 155 | − set -euo pipefail | |
| 156 | − shopt -s nullglob | |
| 157 | − archives=(dist/CLIProxyAPI_*.tar.gz dist/CLIProxyAPI_*.zip) | |
| 158 | − if [[ ${#archives[@]} -ne 1 ]]; then | |
| 159 | − printf 'expected one archive, found %s\n' "${#archives[@]}" >&2 | |
| 160 | − printf '%s\n' "${archives[@]}" >&2 | |
| 161 | − exit 1 | |
| 162 | − fi | |
| 163 | − archive="${archives[0]}" | |
| 164 | − archive_name="$(basename "$archive")" | |
| 165 | − if command -v sha256sum >/dev/null 2>&1; then | |
| 166 | − sha256sum "$archive" | awk -v name="$archive_name" '{print $1 " " name}' > "$archive.sha256" | |
| 167 | − else | |
| 168 | − shasum -a 256 "$archive" | awk -v name="$archive_name" '{print $1 " " name}' > "$archive.sha256" | |
| 169 | − fi | |
| 170 | 152 | - uses: actions/upload-artifact@v4 |
| 171 | 153 | with: |
| 172 | 154 | name: ${{ matrix.target }} |
| @@ -179,9 +161,9 @@ jobs: · 6 unmodified lines | ||
| 179 | 161 | run: | |
| 180 | 162 | set -euo pipefail |
| 181 | 163 | shopt -s nullglob |
| 182 | − assets=(dist/CLIProxyAPI_*.tar.gz dist/CLIProxyAPI_*.zip dist/CLIProxyAPI_*.tar.gz.sha256 dist/CLIProxyAPI_*.zip.sha256) | |
| 183 | − if [[ ${#assets[@]} -lt 2 ]]; then | |
| 184 | − printf 'expected archive and checksum assets, found %s\n' "${#assets[@]}" >&2 | |
| 164 | + assets=(dist/CLIProxyAPI_*.tar.gz dist/CLIProxyAPI_*.zip) | |
| 165 | + if [[ ${#assets[@]} -eq 0 ]]; then | |
| 166 | + printf 'expected archive assets, found %s\n' "${#assets[@]}" >&2 | |
| 185 | 167 | printf '%s\n' "${assets[@]}" >&2 |
| 186 | 168 | exit 1 |
| 187 | 169 | fi |
| @@ -302,20 +284,6 @@ jobs: · 114 unmodified lines | ||
| 302 | 284 | |
| 303 | 285 | cp LICENSE README.md README_CN.md config.example.yaml "$archive_dir/" |
| 304 | 286 | tar -C "$archive_dir" -czf "dist/$archive_name" cli-proxy-api LICENSE README.md README_CN.md config.example.yaml |
| 305 | − - name: Create asset checksum | |
| 306 | − shell: bash | |
| 307 | − run: | | |
| 308 | − set -euo pipefail | |
| 309 | − shopt -s nullglob | |
| 310 | − archives=(dist/CLIProxyAPI_*.tar.gz) | |
| 311 | − if [[ ${#archives[@]} -ne 1 ]]; then | |
| 312 | − printf 'expected one archive, found %s\n' "${#archives[@]}" >&2 | |
| 313 | − printf '%s\n' "${archives[@]}" >&2 | |
| 314 | − exit 1 | |
| 315 | − fi | |
| 316 | − archive="${archives[0]}" | |
| 317 | − archive_name="$(basename "$archive")" | |
| 318 | − sha256sum "$archive" | awk -v name="$archive_name" '{print $1 " " name}' > "$archive.sha256" | |
| 319 | 287 | - uses: actions/upload-artifact@v4 |
| 320 | 288 | with: |
| 321 | 289 | name: ${{ matrix.target }} |
| @@ -328,9 +296,9 @@ jobs: · 6 unmodified lines | ||
| 328 | 296 | run: | |
| 329 | 297 | set -euo pipefail |
| 330 | 298 | shopt -s nullglob |
| 331 | − assets=(dist/CLIProxyAPI_*.tar.gz dist/CLIProxyAPI_*.tar.gz.sha256) | |
| 332 | − if [[ ${#assets[@]} -lt 2 ]]; then | |
| 333 | − printf 'expected archive and checksum assets, found %s\n' "${#assets[@]}" >&2 | |
| 299 | + assets=(dist/CLIProxyAPI_*.tar.gz) | |
| 300 | + if [[ ${#assets[@]} -eq 0 ]]; then | |
| 301 | + printf 'expected archive assets, found %s\n' "${#assets[@]}" >&2 | |
| 334 | 302 | printf '%s\n' "${assets[@]}" >&2 |
| 335 | 303 | exit 1 |
| 336 | 304 | fi |
| @@ -438,20 +406,6 @@ jobs: · 101 unmodified lines | ||
| 438 | 406 | |
| 439 | 407 | cp LICENSE README.md README_CN.md config.example.yaml "$archive_dir/" |
| 440 | 408 | tar -C "$archive_dir" -czf "dist/$archive_name" cli-proxy-api LICENSE README.md README_CN.md config.example.yaml |
| 441 | − - name: Create asset checksum | |
| 442 | − shell: bash | |
| 443 | − run: | | |
| 444 | − set -euo pipefail | |
| 445 | − shopt -s nullglob | |
| 446 | − archives=(dist/CLIProxyAPI_*.tar.gz) | |
| 447 | − if [[ ${#archives[@]} -ne 1 ]]; then | |
| 448 | − printf 'expected one archive, found %s\n' "${#archives[@]}" >&2 | |
| 449 | − printf '%s\n' "${archives[@]}" >&2 | |
| 450 | − exit 1 | |
| 451 | − fi | |
| 452 | − archive="${archives[0]}" | |
| 453 | − archive_name="$(basename "$archive")" | |
| 454 | − sha256sum "$archive" | awk -v name="$archive_name" '{print $1 " " name}' > "$archive.sha256" | |
| 455 | 409 | - uses: actions/upload-artifact@v4 |
| 456 | 410 | with: |
| 457 | 411 | name: ${{ matrix.target }} |
| @@ -464,9 +418,9 @@ jobs: · 6 unmodified lines | ||
| 464 | 418 | run: | |
| 465 | 419 | set -euo pipefail |
| 466 | 420 | shopt -s nullglob |
| 467 | − assets=(dist/CLIProxyAPI_*.tar.gz dist/CLIProxyAPI_*.tar.gz.sha256) | |
| 468 | − if [[ ${#assets[@]} -lt 2 ]]; then | |
| 469 | − printf 'expected archive and checksum assets, found %s\n' "${#assets[@]}" >&2 | |
| 421 | + assets=(dist/CLIProxyAPI_*.tar.gz) | |
| 422 | + if [[ ${#assets[@]} -eq 0 ]]; then | |
| 423 | + printf 'expected archive assets, found %s\n' "${#assets[@]}" >&2 | |
| 470 | 424 | printf '%s\n' "${assets[@]}" >&2 |
| 471 | 425 | exit 1 |
| 472 | 426 | fi |
| @@ -586,20 +540,6 @@ jobs: · 113 unmodified lines | ||
| 586 | 540 | cp "dist/${TARGET}/bin/cli-proxy-api" "$archive_dir/cli-proxy-api" |
| 587 | 541 | cp LICENSE README.md README_CN.md config.example.yaml "$archive_dir/" |
| 588 | 542 | tar -C "$archive_dir" -czf "dist/$archive_name" cli-proxy-api LICENSE README.md README_CN.md config.example.yaml |
| 589 | − - name: Create asset checksum | |
| 590 | − shell: bash | |
| 591 | − run: | | |
| 592 | − set -euo pipefail | |
| 593 | − shopt -s nullglob | |
| 594 | − archives=(dist/CLIProxyAPI_*.tar.gz) | |
| 595 | − if [[ ${#archives[@]} -ne 1 ]]; then | |
| 596 | − printf 'expected one archive, found %s\n' "${#archives[@]}" >&2 | |
| 597 | − printf '%s\n' "${archives[@]}" >&2 | |
| 598 | − exit 1 | |
| 599 | − fi | |
| 600 | − archive="${archives[0]}" | |
| 601 | − archive_name="$(basename "$archive")" | |
| 602 | − sha256sum "$archive" | awk -v name="$archive_name" '{print $1 " " name}' > "$archive.sha256" | |
| 603 | 543 | - uses: actions/upload-artifact@v4 |
| 604 | 544 | with: |
| 605 | 545 | name: freebsd-${{ matrix.goarch }} |
| @@ -612,9 +552,9 @@ jobs: · 6 unmodified lines | ||
| 612 | 552 | run: | |
| 613 | 553 | set -euo pipefail |
| 614 | 554 | shopt -s nullglob |
| 615 | − assets=(dist/CLIProxyAPI_*.tar.gz dist/CLIProxyAPI_*.tar.gz.sha256) | |
| 616 | − if [[ ${#assets[@]} -lt 2 ]]; then | |
| 617 | − printf 'expected archive and checksum assets, found %s\n' "${#assets[@]}" >&2 | |
| 555 | + assets=(dist/CLIProxyAPI_*.tar.gz) | |
| 556 | + if [[ ${#assets[@]} -eq 0 ]]; then | |
| 557 | + printf 'expected archive assets, found %s\n' "${#assets[@]}" >&2 | |
| 618 | 558 | printf '%s\n' "${assets[@]}" >&2 |
| 619 | 559 | exit 1 |
| 620 | 560 | fi |