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