修改自动构建
Build and publish packages and Docker images / Test, build and publish (push) Failing after 9m24s

This commit is contained in:
2026-07-24 08:51:24 +08:00 Unverified
parent ef8222c138
commit 3162a5d3a3
3 changed files with 163 additions and 9 deletions
+66 -4
View File
@@ -1,10 +1,16 @@
name: Build and publish Docker images
name: Build and publish packages and Docker images
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
include_extended_platforms:
description: "同时构建 Windows ARM64 和 macOS x64/ARM64"
required: false
default: false
type: boolean
jobs:
publish:
@@ -23,9 +29,56 @@ jobs:
with:
dotnet-version: "10.0.x"
- name: Set up Node.js
uses: https://github.com/actions/setup-node@v4
with:
node-version: "24"
cache: npm
cache-dependency-path: src/Eis.Web/ClientApp/package-lock.json
- name: Build Vue application
working-directory: src/Eis.Web/ClientApp
run: |
npm ci
npm run build
- name: Run tests
run: dotnet test Eis.slnx --configuration Release
- name: Determine package version
id: package_version
shell: bash
env:
INCLUDE_EXTENDED_PLATFORMS: ${{ inputs.include_extended_platforms }}
run: |
set -euo pipefail
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
version="${GITHUB_REF_NAME#v}"
else
version="0.0.0-dev.${GITHUB_RUN_NUMBER:-0}"
fi
profile=default
if [[ "${INCLUDE_EXTENDED_PLATFORMS:-false}" == "true" ]]; then
profile=all
fi
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "profile=$profile" >> "$GITHUB_OUTPUT"
- name: Build self-contained platform packages
shell: bash
run: |
bash ./scripts/publish-platform-packages.sh \
"${{ steps.package_version.outputs.version }}" \
"artifacts/packages" \
"${{ steps.package_version.outputs.profile }}"
- name: Upload platform packages as workflow artifact
uses: https://github.com/actions/upload-artifact@v4
with:
name: eis-${{ steps.package_version.outputs.version }}-${{ steps.package_version.outputs.profile }}-platform-packages
path: artifacts/packages/*
if-no-files-found: error
- name: Set up QEMU
uses: https://github.com/docker/setup-qemu-action@v3
@@ -53,9 +106,8 @@ jobs:
images: |
docker.io/${{ vars.DOCKERHUB_IMAGE }}
git.biss.click/biss/exam-information-system
flavor: latest=false
flavor: latest=auto
tags: |
type=raw,value=latest,enable=${{ gitea.ref == 'refs/heads/master' }}
type=sha,format=short,prefix=sha-
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
@@ -91,8 +143,18 @@ jobs:
tag_name: ${{ gitea.ref_name }}
name: ${{ gitea.ref_name }}
prerelease: ${{ steps.release_type.outputs.prerelease }}
files: |
artifacts/packages/*
body: |
Docker 镜像已发布:
已发布以下自包含程序包,无需预装 .NET 运行时
- Windows x64:下载对应的 `.zip`
- Linux x64 / ARM64:下载对应的 `.tar.gz`
- 使用 `SHA256SUMS` 校验下载文件
Windows ARM64 与 macOS Intel / Apple Silicon 包可在 Actions 页面选择扩展平台后手动构建。
Docker 多架构镜像(linux/amd64、linux/arm64):
```text
docker pull docker.io/${{ vars.DOCKERHUB_IMAGE }}:${{ steps.metadata.outputs.version }}