ci(release): 优化 V2 构建发布并发

This commit is contained in:
tbphp committed 2026-08-19 15:04:44 +08:00
1 parent 4ba93ab196
commit 3e1157a2af
4 files changed
+272 -47

No files matched your search

+17
View File
@@ -80,6 +80,22 @@ jobs:
- name: Run race-enabled tests
run: go test -race -count=1 -timeout=15m . ./internal/...
race-cpa:
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod
cache: true
cache-dependency-path: third_party/cpaembedded/go.sum
- name: Run embedded CPA bridge race-enabled tests
working-directory: third_party/cpaembedded
run: go test -race -count=1 -timeout=15m ./...
@@ -90,6 +106,7 @@ jobs:
timeout-minutes: 15
strategy:
fail-fast: false
max-parallel: 2
matrix:
include:
- driver: mysql
+126 -38
View File
@@ -83,7 +83,7 @@ jobs:
verify-and-build-web:
needs: validate-tag
runs-on: ubuntu-24.04
timeout-minutes: 20
timeout-minutes: 10
steps:
- name: Checkout tag commit
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
@@ -93,6 +93,24 @@ jobs:
- name: Validate and build web UI
uses: ./.github/actions/web-ci
- name: Upload verified web dist
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: verified-web-dist
path: internal/webui/dist
if-no-files-found: error
retention-days: 14
static-checks:
needs: validate-tag
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- name: Checkout tag commit
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
@@ -127,14 +145,6 @@ jobs:
- name: Check repository invariants
run: git diff --check
- name: Upload verified web dist
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: verified-web-dist
path: internal/webui/dist
if-no-files-found: error
retention-days: 14
race-tests:
needs: validate-tag
runs-on: ubuntu-24.04
@@ -154,6 +164,23 @@ jobs:
- name: Run race-enabled tests
run: go test -race -count=1 -timeout=15m . ./internal/...
race-cpa:
needs: validate-tag
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- name: Checkout tag commit
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod
cache: true
cache-dependency-path: third_party/cpaembedded/go.sum
- name: Run embedded CPA bridge race-enabled tests
working-directory: third_party/cpaembedded
run: go test -race -count=1 -timeout=15m ./...
@@ -165,6 +192,7 @@ jobs:
timeout-minutes: 15
strategy:
fail-fast: false
max-parallel: 2
matrix:
include:
- driver: mysql
@@ -220,6 +248,7 @@ jobs:
timeout-minutes: 15
strategy:
fail-fast: true
max-parallel: 5
matrix:
include:
- goos: linux
@@ -274,8 +303,8 @@ jobs:
if-no-files-found: error
retention-days: 14
package-checksums:
needs: build-binaries
package-metadata:
needs: validate-tag
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
@@ -290,15 +319,9 @@ jobs:
go-version-file: go.mod
cache: true
- name: Download all release binaries
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: binary-gpt-load-*
path: release
merge-multiple: true
- name: Generate release SBOM and license assets
run: |
mkdir -p release
cp LICENSE release/LICENSE
cp THIRD_PARTY_NOTICES.md release/THIRD_PARTY_NOTICES.md
cp LICENSES/Apache-2.0.txt release/Apache-2.0.txt
@@ -307,6 +330,34 @@ jobs:
go run github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@v1.10.0 \
mod -json -noserial -notimestamp -output release/bom.cdx.json .
- name: Upload release metadata
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: release-metadata
path: release
if-no-files-found: error
retention-days: 14
package-checksums:
needs:
- build-binaries
- package-metadata
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- name: Download all release binaries
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: binary-gpt-load-*
path: release
merge-multiple: true
- name: Download release metadata
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: release-metadata
path: release
- name: Generate SHA256SUMS
working-directory: release
run: |
@@ -339,6 +390,7 @@ jobs:
timeout-minutes: 10
strategy:
fail-fast: true
max-parallel: 5
matrix:
include:
- runner: ubuntu-24.04
@@ -385,9 +437,7 @@ jobs:
exit $LASTEXITCODE
docker-smoke:
needs:
- validate-tag
- verify-and-build-web
needs: validate-tag
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
@@ -408,7 +458,9 @@ jobs:
needs:
- validate-tag
- verify-and-build-web
- static-checks
- race-tests
- race-cpa
- build-binaries
- package-checksums
- native-artifact-smoke
@@ -974,6 +1026,7 @@ jobs:
contents: read
strategy:
fail-fast: true
max-parallel: 5
matrix:
include:
- runner: ubuntu-24.04
@@ -1022,13 +1075,61 @@ jobs:
RELEASE_SMOKE_CHECKSUM_FILE: ${{ github.workspace }}/draft-release/SHA256SUMS
run: .github/scripts/release-native-smoke.ps1
post-publish-image-smoke:
needs:
- validate-tag
- publish-images
runs-on: ubuntu-24.04
timeout-minutes: 30
permissions:
contents: read
packages: read
strategy:
fail-fast: false
max-parallel: 2
matrix:
include:
- registry: ghcr
repository: ghcr.io/tbphp/gpt-load
suffix: ghcr
- registry: dockerhub
repository: tbphp/gpt-load
suffix: dockerhub
steps:
- name: Checkout tag commit
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Log in to GHCR for runtime smoke
if: ${{ matrix.registry == 'ghcr' }}
uses: docker/login-action@371161bbe7024a29a25c5e19bfcbc0804fe9ad2c # v4.5.2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to Docker Hub for runtime smoke
if: ${{ matrix.registry == 'dockerhub' }}
uses: docker/login-action@371161bbe7024a29a25c5e19bfcbc0804fe9ad2c # v4.5.2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_READ_TOKEN }}
- name: Run full runtime smoke for published exact image
shell: bash
env:
RELEASE_VERSION: ${{ github.ref_name }}
RELEASE_SMOKE_SOURCE_IMAGE: ${{ matrix.repository }}:${{ needs.validate-tag.outputs.image_exact }}
RELEASE_SMOKE_SUFFIX: ${{ github.run_id }}-${{ matrix.suffix }}
run: .github/scripts/release-docker-smoke.sh
post-publish-verify:
needs:
- validate-tag
- publication-preflight
- publish-github
- publish-images
- post-publish-native-smoke
runs-on: ubuntu-24.04
timeout-minutes: 45
permissions:
@@ -1188,22 +1289,6 @@ jobs:
done
test "${ghcr_exact_digest}" = "${dockerhub_exact_digest}"
- name: Run full runtime smoke for both published exact images
shell: bash
env:
RELEASE_VERSION: ${{ github.ref_name }}
run: |
set -euo pipefail
for source_and_suffix in \
"ghcr.io/tbphp/gpt-load:${{ needs.validate-tag.outputs.image_exact }}|ghcr" \
"tbphp/gpt-load:${{ needs.validate-tag.outputs.image_exact }}|dockerhub"; do
source_image="${source_and_suffix%%|*}"
smoke_suffix="${source_and_suffix##*|}"
RELEASE_SMOKE_SOURCE_IMAGE="${source_image}" \
RELEASE_SMOKE_SUFFIX="${GITHUB_RUN_ID}-${smoke_suffix}" \
.github/scripts/release-docker-smoke.sh
done
reconcile-publication:
if: ${{ always() }}
needs:
@@ -1211,6 +1296,7 @@ jobs:
- publish-images
- publish-github
- post-publish-native-smoke
- post-publish-image-smoke
- post-publish-verify
runs-on: ubuntu-24.04
timeout-minutes: 10
@@ -1256,6 +1342,7 @@ jobs:
IMAGE_WRITER_RESULT: ${{ needs.publish-images.result }}
GITHUB_WRITER_RESULT: ${{ needs.publish-github.result }}
NATIVE_POST_RESULT: ${{ needs.post-publish-native-smoke.result }}
IMAGE_SMOKE_RESULT: ${{ needs.post-publish-image-smoke.result }}
VERIFY_POST_RESULT: ${{ needs.post-publish-verify.result }}
shell: bash
run: |
@@ -1331,6 +1418,7 @@ jobs:
printf -- '- image writer: `%s`\n' "${IMAGE_WRITER_RESULT}"
printf -- '- GitHub writer: `%s`\n' "${GITHUB_WRITER_RESULT}"
printf -- '- draft native smoke: `%s`\n' "${NATIVE_POST_RESULT}"
printf -- '- published image smoke: `%s`\n' "${IMAGE_SMOKE_RESULT}"
printf -- '- draft and image verification: `%s`\n' "${VERIFY_POST_RESULT}"
printf -- '- GitHub exact inventory: `%s`\n' "${github_inventory}"
printf -- '- GHCR exact inventory: `%s`\n' "${ghcr_inventory}"