Add files via upload

This commit is contained in:
Jason
2026-04-28 14:00:26 +08:00
committed by GitHub
parent fd9b7c4546
commit dfe0186267

View File

@@ -13,42 +13,8 @@ env:
ELECTRON_BUILDER_BINARIES_MIRROR: https://github.com/electron-userland/electron-builder-binaries/releases/download/
jobs:
prepare-release:
runs-on: ubuntu-latest
steps:
- name: Check out git repository
uses: actions/checkout@v5
with:
fetch-depth: 1
- name: Ensure GitHub release exists
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
set -euo pipefail
source .github/scripts/release-utils.sh
TAG="$GITHUB_REF_NAME"
REPO="$GITHUB_REPOSITORY"
VERSION="${TAG#v}"
prerelease_args=()
if [[ "$VERSION" == *-* ]]; then
prerelease_args+=(--prerelease)
fi
if gh release view "$TAG" --repo "$REPO" >/dev/null 2>&1; then
retry_cmd 5 3 gh release edit "$TAG" --repo "$REPO" --draft=false "${prerelease_args[@]}"
else
retry_cmd 5 3 gh release create "$TAG" --repo "$REPO" --title "$TAG" --notes "Release $TAG" --target "$GITHUB_SHA" "${prerelease_args[@]}"
fi
wait_for_release_id "$REPO" "$TAG" 12 2 >/dev/null
release-mac-arm64:
runs-on: macos-14
needs: prepare-release
steps:
- name: Check out git repository
@@ -77,29 +43,19 @@ jobs:
npx tsc
npx vite build
- name: Package and Upload macOS arm64 (unsigned DMG + ZIP)
- name: Package and Publish macOS arm64 (unsigned DMG + ZIP)
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CSC_IDENTITY_AUTO_DISCOVERY: "false"
shell: bash
run: |
set -euo pipefail
source .github/scripts/release-utils.sh
export ELECTRON_BUILDER_BINARIES_MIRROR="https://github.com/electron-userland/electron-builder-binaries/releases/download/"
echo "Using ELECTRON_BUILDER_BINARIES_MIRROR=$ELECTRON_BUILDER_BINARIES_MIRROR"
if ! npx electron-builder --mac dmg zip --arm64 --publish never '--config.publish.owner=${{ github.repository_owner }}' '--config.publish.repo=${{ github.event.repository.name }}'; then
if ! npx electron-builder --mac dmg zip --arm64 --publish always '--config.publish.owner=${{ github.repository_owner }}' '--config.publish.repo=${{ github.event.repository.name }}'; then
echo "::warning::DMG packaging failed (hdiutil instability on runner). Retrying with ZIP only."
npx electron-builder --mac zip --arm64 --publish never '--config.publish.owner=${{ github.repository_owner }}' '--config.publish.repo=${{ github.event.repository.name }}'
npx electron-builder --mac zip --arm64 --publish always '--config.publish.owner=${{ github.repository_owner }}' '--config.publish.repo=${{ github.event.repository.name }}'
fi
assets=()
while IFS= read -r file; do
assets+=("$file")
done < <(find release -maxdepth 1 -type f | sort)
if [ "${#assets[@]}" -eq 0 ]; then
echo "No release files found in ./release"
exit 1
fi
upload_release_assets_with_retry "$GITHUB_REPOSITORY" "$GITHUB_REF_NAME" "${assets[@]}"
- name: Inject minimumVersion into latest yml
env:
@@ -125,7 +81,6 @@ jobs:
release-linux:
runs-on: ubuntu-latest
needs: prepare-release
steps:
- name: Check out git repository
@@ -159,23 +114,11 @@ jobs:
npx tsc
npx vite build
- name: Package and Upload Linux
- name: Package and Publish Linux
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
set -euo pipefail
source .github/scripts/release-utils.sh
npx electron-builder --linux --publish never '--config.publish.owner=${{ github.repository_owner }}' '--config.publish.repo=${{ github.event.repository.name }}'
assets=()
while IFS= read -r file; do
assets+=("$file")
done < <(find release -maxdepth 1 -type f | sort)
if [ "${#assets[@]}" -eq 0 ]; then
echo "No release files found in ./release"
exit 1
fi
upload_release_assets_with_retry "$GITHUB_REPOSITORY" "$GITHUB_REF_NAME" "${assets[@]}"
npx electron-builder --linux --publish always '--config.publish.owner=${{ github.repository_owner }}' '--config.publish.repo=${{ github.event.repository.name }}'
- name: Inject minimumVersion into latest yml
env:
@@ -196,7 +139,6 @@ jobs:
release:
runs-on: windows-latest
needs: prepare-release
steps:
- name: Check out git repository
@@ -225,23 +167,11 @@ jobs:
npx tsc
npx vite build
- name: Package and Upload Windows x64
- name: Package and Publish
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
set -euo pipefail
source .github/scripts/release-utils.sh
npx electron-builder --win nsis --x64 --publish never '--config.publish.owner=${{ github.repository_owner }}' '--config.publish.repo=${{ github.event.repository.name }}' '--config.artifactName=${productName}-${version}-x64-Setup.${ext}'
assets=()
while IFS= read -r file; do
assets+=("$file")
done < <(find release -maxdepth 1 -type f | sort)
if [ "${#assets[@]}" -eq 0 ]; then
echo "No release files found in ./release"
exit 1
fi
upload_release_assets_with_retry "$GITHUB_REPOSITORY" "$GITHUB_REF_NAME" "${assets[@]}"
npx electron-builder --win nsis --x64 --publish always '--config.publish.owner=${{ github.repository_owner }}' '--config.publish.repo=${{ github.event.repository.name }}' '--config.artifactName=${productName}-${version}-x64-Setup.${ext}'
- name: Inject minimumVersion into latest yml
env:
@@ -262,7 +192,6 @@ jobs:
release-windows-arm64:
runs-on: windows-latest
needs: prepare-release
steps:
- name: Check out git repository
@@ -291,23 +220,11 @@ jobs:
npx tsc
npx vite build
- name: Package and Upload Windows arm64
- name: Package and Publish Windows arm64
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
set -euo pipefail
source .github/scripts/release-utils.sh
npx electron-builder --win nsis --arm64 --publish never '--config.publish.owner=${{ github.repository_owner }}' '--config.publish.repo=${{ github.event.repository.name }}' '--config.publish.channel=latest-arm64' '--config.artifactName=${productName}-${version}-arm64-Setup.${ext}'
assets=()
while IFS= read -r file; do
assets+=("$file")
done < <(find release -maxdepth 1 -type f | sort)
if [ "${#assets[@]}" -eq 0 ]; then
echo "No release files found in ./release"
exit 1
fi
upload_release_assets_with_retry "$GITHUB_REPOSITORY" "$GITHUB_REF_NAME" "${assets[@]}"
npx electron-builder --win nsis --arm64 --publish always '--config.publish.owner=${{ github.repository_owner }}' '--config.publish.repo=${{ github.event.repository.name }}' '--config.publish.channel=latest-arm64' '--config.artifactName=${productName}-${version}-arm64-Setup.${ext}'
- name: Inject minimumVersion into latest yml
env: