修复构建错误
This commit is contained in:
+51
-40
@@ -10,6 +10,7 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
@@ -20,6 +21,11 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: gongyun/app
|
||||
ref: ${{ github.ref }}
|
||||
token: ${{ secrets.GITEA_TOKEN }}
|
||||
github-server-url: https://git.saont.net
|
||||
|
||||
- name: Set up Java
|
||||
uses: actions/setup-java@v4
|
||||
@@ -69,45 +75,50 @@ jobs:
|
||||
name: android-release
|
||||
path: gongyun-app-release.apk
|
||||
|
||||
windows:
|
||||
name: Build Windows
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: stable
|
||||
cache: true
|
||||
|
||||
- name: Enable Windows desktop
|
||||
run: flutter config --enable-windows-desktop
|
||||
|
||||
- name: Install dependencies
|
||||
run: flutter pub get
|
||||
|
||||
- name: Build Windows release
|
||||
run: flutter build windows --release
|
||||
|
||||
- name: Package Windows release
|
||||
shell: pwsh
|
||||
run: Compress-Archive -Path build\windows\x64\runner\Release\* -DestinationPath gongyun.zip -Force
|
||||
|
||||
- name: Upload Windows artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: windows-release
|
||||
path: gongyun.zip
|
||||
# windows:
|
||||
# name: Build Windows
|
||||
# runs-on: windows-latest
|
||||
#
|
||||
# steps:
|
||||
# - name: Checkout
|
||||
# uses: actions/checkout@v4
|
||||
# with:
|
||||
# repository: gongyun/app
|
||||
# ref: ${{ github.ref }}
|
||||
# token: ${{ secrets.GITEA_TOKEN }}
|
||||
# github-server-url: https://git.saont.net
|
||||
#
|
||||
# - name: Set up Flutter
|
||||
# uses: subosito/flutter-action@v2
|
||||
# with:
|
||||
# channel: stable
|
||||
# cache: true
|
||||
#
|
||||
# - name: Enable Windows desktop
|
||||
# run: flutter config --enable-windows-desktop
|
||||
#
|
||||
# - name: Install dependencies
|
||||
# run: flutter pub get
|
||||
#
|
||||
# - name: Build Windows release
|
||||
# run: flutter build windows --release
|
||||
#
|
||||
# - name: Package Windows release
|
||||
# shell: pwsh
|
||||
# run: Compress-Archive -Path build\windows\x64\runner\Release\* -DestinationPath gongyun.zip -Force
|
||||
#
|
||||
# - name: Upload Windows artifact
|
||||
# uses: actions/upload-artifact@v4
|
||||
# with:
|
||||
# name: windows-release
|
||||
# path: gongyun.zip
|
||||
|
||||
release:
|
||||
name: Publish Release
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- android
|
||||
- windows
|
||||
# - windows
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
permissions:
|
||||
actions: read
|
||||
@@ -121,11 +132,11 @@ jobs:
|
||||
name: android-release
|
||||
path: dist
|
||||
|
||||
- name: Download Windows artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: windows-release
|
||||
path: dist
|
||||
# - name: Download Windows artifact
|
||||
# uses: actions/download-artifact@v4
|
||||
# with:
|
||||
# name: windows-release
|
||||
# path: dist
|
||||
|
||||
- name: Publish Gitea release
|
||||
shell: bash
|
||||
@@ -200,7 +211,7 @@ jobs:
|
||||
python3 - <<'PY' > asset-ids-to-delete.txt
|
||||
import json
|
||||
|
||||
names = {"gongyun-app-release.apk", "gongyun.zip"}
|
||||
names = {"gongyun-app-release.apk"}
|
||||
with open("assets.json", encoding="utf-8") as f:
|
||||
for asset in json.load(f):
|
||||
if asset.get("name") in names:
|
||||
@@ -229,4 +240,4 @@ jobs:
|
||||
}
|
||||
|
||||
upload_asset dist/gongyun-app-release.apk
|
||||
upload_asset dist/gongyun.zip
|
||||
# upload_asset dist/gongyun.zip
|
||||
|
||||
Reference in New Issue
Block a user