85 lines
2.4 KiB
YAML
85 lines
2.4 KiB
YAML
name: Build beta packages
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*-beta*"
|
|
workflow_dispatch:
|
|
inputs:
|
|
include_extended_platforms:
|
|
description: "同时构建 Windows ARM64 和 macOS x64/ARM64"
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
|
|
jobs:
|
|
package:
|
|
name: Build and package beta
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
code: read
|
|
|
|
steps:
|
|
- name: Check out repository
|
|
uses: https://github.com/actions/checkout@v4
|
|
|
|
- name: Initialize CaptchaKit submodule
|
|
run: git submodule update --init --recursive packages/CaptchaKit
|
|
|
|
- name: Set up .NET
|
|
uses: https://github.com/actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: "11.0.100"
|
|
|
|
- name: Set up Node.js
|
|
uses: https://github.com/actions/setup-node@v4
|
|
with:
|
|
node-version: "26.14.0"
|
|
cache: npm
|
|
cache-dependency-path: web/package-lock.json
|
|
|
|
- name: Build Vue application
|
|
working-directory: web
|
|
run: |
|
|
npm ci
|
|
npm run build
|
|
|
|
- name: Determine package version and platform profile
|
|
id: package
|
|
shell: bash
|
|
env:
|
|
REF_TYPE: ${{ gitea.ref_type }}
|
|
REF_NAME: ${{ gitea.ref_name }}
|
|
RUN_NUMBER: ${{ gitea.run_number }}
|
|
INCLUDE_EXTENDED_PLATFORMS: ${{ inputs.include_extended_platforms }}
|
|
run: |
|
|
set -euo pipefail
|
|
if [[ "$REF_TYPE" == "tag" && "$REF_NAME" == v*-beta* ]]; then
|
|
version="${REF_NAME#v}"
|
|
else
|
|
version="0.0.0-beta.${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 framework-dependent platform packages
|
|
shell: bash
|
|
run: |
|
|
bash ./scripts/publish-platform-packages.sh \
|
|
"${{ steps.package.outputs.version }}" \
|
|
"artifacts/packages" \
|
|
"${{ steps.package.outputs.profile }}"
|
|
|
|
- name: Upload beta packages as workflow artifact
|
|
uses: https://github.com/christopherHX/gitea-upload-artifact@v4
|
|
with:
|
|
name: jiaowu-${{ steps.package.outputs.version }}-${{ steps.package.outputs.profile }}-packages
|
|
path: artifacts/packages/*
|
|
if-no-files-found: error
|