History

chore(build): remove checksum generation from release workflows

- 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.

Luis Pater committed 5 months ago

Commit 07c607b1 parent 856dc811 file · +12 −72Browse files

Showing the changes to .github (1 of 1 file). Show all

Unified · Split

.github/workflows/release.yaml+12−72
@@ -149,24 +149,6 @@ jobs: · 148 unmodified lines
149 else149 else
150 tar -C "$archive_dir" -czf "dist/$archive_name" "$binary_name" LICENSE README.md README_CN.md config.example.yaml150 tar -C "$archive_dir" -czf "dist/$archive_name" "$binary_name" LICENSE README.md README_CN.md config.example.yaml
151 fi151 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 - uses: actions/upload-artifact@v4152 - uses: actions/upload-artifact@v4
171 with:153 with:
172 name: ${{ matrix.target }}154 name: ${{ matrix.target }}
@@ -179,9 +161,9 @@ jobs: · 6 unmodified lines
179 run: |161 run: |
180 set -euo pipefail162 set -euo pipefail
181 shopt -s nullglob163 shopt -s nullglob
182 assets=(dist/CLIProxyAPI_*.tar.gz dist/CLIProxyAPI_*.zip dist/CLIProxyAPI_*.tar.gz.sha256 dist/CLIProxyAPI_*.zip.sha256)164 assets=(dist/CLIProxyAPI_*.tar.gz dist/CLIProxyAPI_*.zip)
183 if [[ ${#assets[@]} -lt 2 ]]; then165 if [[ ${#assets[@]} -eq 0 ]]; then
184 printf 'expected archive and checksum assets, found %s\n' "${#assets[@]}" >&2166 printf 'expected archive assets, found %s\n' "${#assets[@]}" >&2
185 printf '%s\n' "${assets[@]}" >&2167 printf '%s\n' "${assets[@]}" >&2
186 exit 1168 exit 1
187 fi169 fi
@@ -302,20 +284,6 @@ jobs: · 114 unmodified lines
302 284
303 cp LICENSE README.md README_CN.md config.example.yaml "$archive_dir/"285 cp LICENSE README.md README_CN.md config.example.yaml "$archive_dir/"
304 tar -C "$archive_dir" -czf "dist/$archive_name" cli-proxy-api LICENSE README.md README_CN.md config.example.yaml286 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 - uses: actions/upload-artifact@v4287 - uses: actions/upload-artifact@v4
320 with:288 with:
321 name: ${{ matrix.target }}289 name: ${{ matrix.target }}
@@ -328,9 +296,9 @@ jobs: · 6 unmodified lines
328 run: |296 run: |
329 set -euo pipefail297 set -euo pipefail
330 shopt -s nullglob298 shopt -s nullglob
331 assets=(dist/CLIProxyAPI_*.tar.gz dist/CLIProxyAPI_*.tar.gz.sha256)299 assets=(dist/CLIProxyAPI_*.tar.gz)
332 if [[ ${#assets[@]} -lt 2 ]]; then300 if [[ ${#assets[@]} -eq 0 ]]; then
333 printf 'expected archive and checksum assets, found %s\n' "${#assets[@]}" >&2301 printf 'expected archive assets, found %s\n' "${#assets[@]}" >&2
334 printf '%s\n' "${assets[@]}" >&2302 printf '%s\n' "${assets[@]}" >&2
335 exit 1303 exit 1
336 fi304 fi
@@ -438,20 +406,6 @@ jobs: · 101 unmodified lines
438 406
439 cp LICENSE README.md README_CN.md config.example.yaml "$archive_dir/"407 cp LICENSE README.md README_CN.md config.example.yaml "$archive_dir/"
440 tar -C "$archive_dir" -czf "dist/$archive_name" cli-proxy-api LICENSE README.md README_CN.md config.example.yaml408 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 - uses: actions/upload-artifact@v4409 - uses: actions/upload-artifact@v4
456 with:410 with:
457 name: ${{ matrix.target }}411 name: ${{ matrix.target }}
@@ -464,9 +418,9 @@ jobs: · 6 unmodified lines
464 run: |418 run: |
465 set -euo pipefail419 set -euo pipefail
466 shopt -s nullglob420 shopt -s nullglob
467 assets=(dist/CLIProxyAPI_*.tar.gz dist/CLIProxyAPI_*.tar.gz.sha256)421 assets=(dist/CLIProxyAPI_*.tar.gz)
468 if [[ ${#assets[@]} -lt 2 ]]; then422 if [[ ${#assets[@]} -eq 0 ]]; then
469 printf 'expected archive and checksum assets, found %s\n' "${#assets[@]}" >&2423 printf 'expected archive assets, found %s\n' "${#assets[@]}" >&2
470 printf '%s\n' "${assets[@]}" >&2424 printf '%s\n' "${assets[@]}" >&2
471 exit 1425 exit 1
472 fi426 fi
@@ -586,20 +540,6 @@ jobs: · 113 unmodified lines
586 cp "dist/${TARGET}/bin/cli-proxy-api" "$archive_dir/cli-proxy-api"540 cp "dist/${TARGET}/bin/cli-proxy-api" "$archive_dir/cli-proxy-api"
587 cp LICENSE README.md README_CN.md config.example.yaml "$archive_dir/"541 cp LICENSE README.md README_CN.md config.example.yaml "$archive_dir/"
588 tar -C "$archive_dir" -czf "dist/$archive_name" cli-proxy-api LICENSE README.md README_CN.md config.example.yaml542 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 - uses: actions/upload-artifact@v4543 - uses: actions/upload-artifact@v4
604 with:544 with:
605 name: freebsd-${{ matrix.goarch }}545 name: freebsd-${{ matrix.goarch }}
@@ -612,9 +552,9 @@ jobs: · 6 unmodified lines
612 run: |552 run: |
613 set -euo pipefail553 set -euo pipefail
614 shopt -s nullglob554 shopt -s nullglob
615 assets=(dist/CLIProxyAPI_*.tar.gz dist/CLIProxyAPI_*.tar.gz.sha256)555 assets=(dist/CLIProxyAPI_*.tar.gz)
616 if [[ ${#assets[@]} -lt 2 ]]; then556 if [[ ${#assets[@]} -eq 0 ]]; then
617 printf 'expected archive and checksum assets, found %s\n' "${#assets[@]}" >&2557 printf 'expected archive assets, found %s\n' "${#assets[@]}" >&2
618 printf '%s\n' "${assets[@]}" >&2558 printf '%s\n' "${assets[@]}" >&2
619 exit 1559 exit 1
620 fi560 fi

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t