mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-19 23:03:43 +00:00
ci: debug windows
This commit is contained in:
1 parent
b45b840afb
commit
745afb600c
1 file changed
+218
-225
+218
-225
@@ -30,23 +30,15 @@ jobs:
|
|||||||
needs: [ release ]
|
needs: [ release ]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-go@v3
|
# - uses: actions/setup-go@v3
|
||||||
with:
|
# with:
|
||||||
go-version: '^1.19'
|
# go-version: '^1.19'
|
||||||
cache: true
|
# cache: true
|
||||||
- uses: subosito/flutter-action@v2
|
# - uses: subosito/flutter-action@v2
|
||||||
- name: Build
|
- name: Build
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ needs.release.outputs.tag_name }}
|
VERSION: ${{ needs.release.outputs.tag_name }}
|
||||||
run: |
|
run: |
|
||||||
go build -tags nosqlite -ldflags="-w -s" -buildmode=c-shared -o ui/flutter/windows/libgopeed.dll github.com/monkeyWie/gopeed/bind/desktop
|
|
||||||
cd ui/flutter
|
|
||||||
flutter build windows
|
|
||||||
$mingw = "C:\ProgramData\Chocolatey\lib\mingw\tools\install\mingw64\bin\"
|
|
||||||
$release = "build\windows\runner\Release\"
|
|
||||||
cp $mingw\libstdc++-6.dll $release
|
|
||||||
cp $mingw\libgcc_s_seh-1.dll $release
|
|
||||||
cp $mingw\libwinpthread-1.dll $release
|
|
||||||
echo @"
|
echo @"
|
||||||
; Script generated by the Inno Setup Script Wizard.
|
; Script generated by the Inno Setup Script Wizard.
|
||||||
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
||||||
@@ -96,6 +88,7 @@ jobs:
|
|||||||
[Run]
|
[Run]
|
||||||
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
|
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
|
||||||
"@ > setup.iss
|
"@ > setup.iss
|
||||||
|
type setup.iss
|
||||||
& "${Env:ProgramFiles(x86)}\Inno Setup 6\iscc.exe" setup.iss
|
& "${Env:ProgramFiles(x86)}\Inno Setup 6\iscc.exe" setup.iss
|
||||||
mv "Output\gopeed.exe" "Output\Gopeed-$env:VERSION-windows-amd64.exe"
|
mv "Output\gopeed.exe" "Output\Gopeed-$env:VERSION-windows-amd64.exe"
|
||||||
- name: Upload
|
- name: Upload
|
||||||
@@ -104,219 +97,219 @@ jobs:
|
|||||||
upload_url: ${{ needs.release.outputs.upload_url }}
|
upload_url: ${{ needs.release.outputs.upload_url }}
|
||||||
asset_path: ui/flutter/build/windows/Output/*
|
asset_path: ui/flutter/build/windows/Output/*
|
||||||
overwrite: true
|
overwrite: true
|
||||||
build-macos-arm64-lib:
|
# build-macos-arm64-lib:
|
||||||
runs-on: ubuntu-latest
|
# runs-on: ubuntu-latest
|
||||||
needs: [ release ]
|
# needs: [ release ]
|
||||||
steps:
|
# steps:
|
||||||
- uses: actions/checkout@v3
|
# - uses: actions/checkout@v3
|
||||||
- uses: actions/setup-go@v3
|
# - uses: actions/setup-go@v3
|
||||||
with:
|
# with:
|
||||||
go-version: '^1.19'
|
# go-version: '^1.19'
|
||||||
cache: true
|
# cache: true
|
||||||
- run: mkdir -p ~/image-cache
|
# - run: mkdir -p ~/image-cache
|
||||||
- id: image-cache
|
# - id: image-cache
|
||||||
uses: actions/cache@v3
|
# uses: actions/cache@v3
|
||||||
with:
|
# with:
|
||||||
path: ~/image-cache
|
# path: ~/image-cache
|
||||||
key: image-cache-xgo-v1.19
|
# key: image-cache-xgo-v1.19
|
||||||
- if: steps.image-cache.outputs.cache-hit != 'true'
|
# - if: steps.image-cache.outputs.cache-hit != 'true'
|
||||||
run: |
|
# run: |
|
||||||
docker pull techknowlogick/xgo:go-1.19.x
|
# docker pull techknowlogick/xgo:go-1.19.x
|
||||||
docker save -o ~/image-cache/xgo.tar techknowlogick/xgo:go-1.19.x
|
# docker save -o ~/image-cache/xgo.tar techknowlogick/xgo:go-1.19.x
|
||||||
- if: steps.image-cache.outputs.cache-hit == 'true'
|
# - if: steps.image-cache.outputs.cache-hit == 'true'
|
||||||
run: docker load -i ~/image-cache/xgo.tar
|
# run: docker load -i ~/image-cache/xgo.tar
|
||||||
- name: Build
|
# - name: Build
|
||||||
run: |
|
# run: |
|
||||||
go install src.techknowlogick.com/xgo@latest
|
# go install src.techknowlogick.com/xgo@latest
|
||||||
xgo --targets=darwin/arm64 -tags="nosqlite" -ldflags="-w -s" -buildmode=c-shared -pkg=bind/desktop -out=libgopeed .
|
# xgo --targets=darwin/arm64 -tags="nosqlite" -ldflags="-w -s" -buildmode=c-shared -pkg=bind/desktop -out=libgopeed .
|
||||||
mv libgopeed-*.dylib libgopeed.dylib
|
# mv libgopeed-*.dylib libgopeed.dylib
|
||||||
- uses: actions/upload-artifact@v3
|
# - uses: actions/upload-artifact@v3
|
||||||
with:
|
# with:
|
||||||
name: macos-arm64-lib
|
# name: macos-arm64-lib
|
||||||
path: libgopeed.dylib
|
# path: libgopeed.dylib
|
||||||
build-macos:
|
# build-macos:
|
||||||
runs-on: macos-latest
|
# runs-on: macos-latest
|
||||||
needs: [ release, build-macos-arm64-lib ]
|
# needs: [ release, build-macos-arm64-lib ]
|
||||||
steps:
|
# steps:
|
||||||
- uses: actions/checkout@v3
|
# - uses: actions/checkout@v3
|
||||||
- uses: actions/setup-go@v3
|
# - uses: actions/setup-go@v3
|
||||||
with:
|
# with:
|
||||||
go-version: '^1.19'
|
# go-version: '^1.19'
|
||||||
cache: true
|
# cache: true
|
||||||
- uses: actions/setup-node@v3
|
# - uses: actions/setup-node@v3
|
||||||
with:
|
# with:
|
||||||
node-version: 16
|
# node-version: 16
|
||||||
- uses: subosito/flutter-action@v2
|
# - uses: subosito/flutter-action@v2
|
||||||
- name: Install appdmg
|
# - name: Install appdmg
|
||||||
run: npm install -g appdmg
|
# run: npm install -g appdmg
|
||||||
- uses: actions/download-artifact@v3
|
# - uses: actions/download-artifact@v3
|
||||||
with:
|
# with:
|
||||||
name: macos-arm64-lib
|
# name: macos-arm64-lib
|
||||||
path: ui/flutter/macos/Frameworks
|
# path: ui/flutter/macos/Frameworks
|
||||||
- name: Build
|
# - name: Build
|
||||||
env:
|
# env:
|
||||||
VERSION: ${{ needs.release.outputs.tag_name }}
|
# VERSION: ${{ needs.release.outputs.tag_name }}
|
||||||
run: |
|
# run: |
|
||||||
PROJECT_DIR=$(pwd)
|
# PROJECT_DIR=$(pwd)
|
||||||
|
|
||||||
cd ui/flutter
|
# cd ui/flutter
|
||||||
flutter build macos
|
# flutter build macos
|
||||||
cd build/macos/Build/Products/Release
|
# cd build/macos/Build/Products/Release
|
||||||
cat>appdmg.json<<EOF
|
# cat>appdmg.json<<EOF
|
||||||
{
|
# {
|
||||||
"title": "Gopeed",
|
# "title": "Gopeed",
|
||||||
"icon": "Gopeed.app/Contents/Resources/AppIcon.icns",
|
# "icon": "Gopeed.app/Contents/Resources/AppIcon.icns",
|
||||||
"contents": [
|
# "contents": [
|
||||||
{ "x": 448, "y": 344, "type": "link", "path": "/Applications" },
|
# { "x": 448, "y": 344, "type": "link", "path": "/Applications" },
|
||||||
{ "x": 192, "y": 344, "type": "file", "path": "Gopeed.app" }
|
# { "x": 192, "y": 344, "type": "file", "path": "Gopeed.app" }
|
||||||
]
|
# ]
|
||||||
}
|
# }
|
||||||
EOF
|
# EOF
|
||||||
mkdir dist
|
# mkdir dist
|
||||||
appdmg appdmg.json dist/Gopeed-$VERSION-macos-arm64.dmg
|
# appdmg appdmg.json dist/Gopeed-$VERSION-macos-arm64.dmg
|
||||||
|
|
||||||
# amd64
|
# # amd64
|
||||||
cd $PROJECT_DIR
|
# cd $PROJECT_DIR
|
||||||
go build -tags nosqlite -ldflags="-w -s" -buildmode=c-shared -o bin/libgopeed.dylib github.com/monkeyWie/gopeed/bind/desktop
|
# go build -tags nosqlite -ldflags="-w -s" -buildmode=c-shared -o bin/libgopeed.dylib github.com/monkeyWie/gopeed/bind/desktop
|
||||||
cp bin/libgopeed.dylib ui/flutter/build/macos/Build/Products/Release/Gopeed.app/Contents/Frameworks/
|
# cp bin/libgopeed.dylib ui/flutter/build/macos/Build/Products/Release/Gopeed.app/Contents/Frameworks/
|
||||||
cd ui/flutter/build/macos/Build/Products/Release
|
# cd ui/flutter/build/macos/Build/Products/Release
|
||||||
appdmg appdmg.json dist/Gopeed-$VERSION-macos-amd64.dmg
|
# appdmg appdmg.json dist/Gopeed-$VERSION-macos-amd64.dmg
|
||||||
- name: Upload
|
# - name: Upload
|
||||||
uses: shogo82148/actions-upload-release-asset@v1
|
# uses: shogo82148/actions-upload-release-asset@v1
|
||||||
with:
|
# with:
|
||||||
upload_url: ${{ needs.release.outputs.upload_url }}
|
# upload_url: ${{ needs.release.outputs.upload_url }}
|
||||||
asset_path: ui/flutter/build/macos/Build/Products/Release/dist/*
|
# asset_path: ui/flutter/build/macos/Build/Products/Release/dist/*
|
||||||
overwrite: true
|
# overwrite: true
|
||||||
build-linux:
|
# build-linux:
|
||||||
runs-on: ubuntu-latest
|
# runs-on: ubuntu-latest
|
||||||
needs: [ release ]
|
# needs: [ release ]
|
||||||
steps:
|
# steps:
|
||||||
- uses: actions/checkout@v3
|
# - uses: actions/checkout@v3
|
||||||
- uses: actions/setup-go@v3
|
# - uses: actions/setup-go@v3
|
||||||
with:
|
# with:
|
||||||
go-version: '^1.19'
|
# go-version: '^1.19'
|
||||||
cache: true
|
# cache: true
|
||||||
- uses: subosito/flutter-action@v2
|
# - uses: subosito/flutter-action@v2
|
||||||
- run: |
|
# - run: |
|
||||||
sudo apt-get update -y
|
# sudo apt-get update -y
|
||||||
sudo apt-get install -y ninja-build libgtk-3-dev
|
# sudo apt-get install -y ninja-build libgtk-3-dev
|
||||||
- name: Build
|
# - name: Build
|
||||||
env:
|
# env:
|
||||||
VERSION: ${{ needs.release.outputs.tag_name }}
|
# VERSION: ${{ needs.release.outputs.tag_name }}
|
||||||
run: |
|
# run: |
|
||||||
go build -tags nosqlite -ldflags="-w -s" -buildmode=c-shared -o ui/flutter/linux/bundle/lib/libgopeed.so github.com/monkeyWie/gopeed/bind/desktop
|
# go build -tags nosqlite -ldflags="-w -s" -buildmode=c-shared -o ui/flutter/linux/bundle/lib/libgopeed.so github.com/monkeyWie/gopeed/bind/desktop
|
||||||
cd ui/flutter
|
# cd ui/flutter
|
||||||
flutter build linux
|
# flutter build linux
|
||||||
mkdir -p debian/gui
|
# mkdir -p debian/gui
|
||||||
cp assets/icon/icon_1024.png debian/gui/gopeed.png
|
# cp assets/icon/icon_1024.png debian/gui/gopeed.png
|
||||||
cat>debian/debian.yaml<<EOF
|
# cat>debian/debian.yaml<<EOF
|
||||||
flutter_app:
|
# flutter_app:
|
||||||
command: gopeed
|
# command: gopeed
|
||||||
arch: x64
|
# arch: x64
|
||||||
parent: /usr/local/lib
|
# parent: /usr/local/lib
|
||||||
control:
|
# control:
|
||||||
Package: gopeed
|
# Package: gopeed
|
||||||
Version: ${VERSION:1}
|
# Version: ${VERSION:1}
|
||||||
Architecture: amd64
|
# Architecture: amd64
|
||||||
Essential: no
|
# Essential: no
|
||||||
Priority: optional
|
# Priority: optional
|
||||||
Depends:
|
# Depends:
|
||||||
Maintainer: monkeyWie
|
# Maintainer: monkeyWie
|
||||||
Description: High speed downloader that supports all platforms.
|
# Description: High speed downloader that supports all platforms.
|
||||||
EOF
|
# EOF
|
||||||
|
|
||||||
cat>debian/gui/gopeed.desktop<<EOF
|
# cat>debian/gui/gopeed.desktop<<EOF
|
||||||
[Desktop Entry]
|
# [Desktop Entry]
|
||||||
Version=${VERSION:1}
|
# Version=${VERSION:1}
|
||||||
Name=Gopeed
|
# Name=Gopeed
|
||||||
GenericName=Gopeed
|
# GenericName=Gopeed
|
||||||
Comment=High speed downloader that supports all platforms.
|
# Comment=High speed downloader that supports all platforms.
|
||||||
Terminal=false
|
# Terminal=false
|
||||||
Type=Application
|
# Type=Application
|
||||||
Categories=Utility
|
# Categories=Utility
|
||||||
Keywords=Flutter;Downloader;
|
# Keywords=Flutter;Downloader;
|
||||||
EOF
|
# EOF
|
||||||
|
|
||||||
dart pub global activate flutter_to_debian
|
# dart pub global activate flutter_to_debian
|
||||||
flutter_to_debian
|
# flutter_to_debian
|
||||||
mv debian/packages/gopeed*.deb debian/packages/Gopeed-$VERSION-linux-amd64.deb
|
# mv debian/packages/gopeed*.deb debian/packages/Gopeed-$VERSION-linux-amd64.deb
|
||||||
- name: Upload
|
# - name: Upload
|
||||||
uses: shogo82148/actions-upload-release-asset@v1
|
# uses: shogo82148/actions-upload-release-asset@v1
|
||||||
with:
|
# with:
|
||||||
upload_url: ${{ needs.release.outputs.upload_url }}
|
# upload_url: ${{ needs.release.outputs.upload_url }}
|
||||||
asset_path: ui/flutter/debian/packages/*
|
# asset_path: ui/flutter/debian/packages/*
|
||||||
overwrite: true
|
# overwrite: true
|
||||||
build-android:
|
# build-android:
|
||||||
runs-on: ubuntu-latest
|
# runs-on: ubuntu-latest
|
||||||
needs: [ release ]
|
# needs: [ release ]
|
||||||
steps:
|
# steps:
|
||||||
- uses: actions/checkout@v3
|
# - uses: actions/checkout@v3
|
||||||
- uses: actions/setup-go@v3
|
# - uses: actions/setup-go@v3
|
||||||
with:
|
# with:
|
||||||
go-version: '^1.19'
|
# go-version: '^1.19'
|
||||||
cache: true
|
# cache: true
|
||||||
- uses: actions/setup-java@v3
|
# - uses: actions/setup-java@v3
|
||||||
with:
|
# with:
|
||||||
distribution: 'zulu'
|
# distribution: 'zulu'
|
||||||
java-version: '11'
|
# java-version: '11'
|
||||||
- uses: subosito/flutter-action@v2
|
# - uses: subosito/flutter-action@v2
|
||||||
- name: Build
|
# - name: Build
|
||||||
env:
|
# env:
|
||||||
VERSION: ${{ needs.release.outputs.tag_name }}
|
# VERSION: ${{ needs.release.outputs.tag_name }}
|
||||||
run: |
|
# run: |
|
||||||
mkdir ui/flutter/android/app/libs
|
# mkdir ui/flutter/android/app/libs
|
||||||
go install golang.org/x/mobile/cmd/gomobile@latest
|
# go install golang.org/x/mobile/cmd/gomobile@latest
|
||||||
gomobile init
|
# gomobile init
|
||||||
gomobile bind -tags nosqlite -ldflags="-w -s" -o ui/flutter/android/app/libs/libgopeed.aar -target=android -androidapi 19 -javapkg=com.gopeed github.com/monkeyWie/gopeed/bind/mobile
|
# gomobile bind -tags nosqlite -ldflags="-w -s" -o ui/flutter/android/app/libs/libgopeed.aar -target=android -androidapi 19 -javapkg=com.gopeed github.com/monkeyWie/gopeed/bind/mobile
|
||||||
cd ui/flutter
|
# cd ui/flutter
|
||||||
flutter build apk
|
# flutter build apk
|
||||||
mkdir dist
|
# mkdir dist
|
||||||
cp build/app/outputs/flutter-apk/app-release.apk dist/Gopeed-$VERSION-android.apk
|
# cp build/app/outputs/flutter-apk/app-release.apk dist/Gopeed-$VERSION-android.apk
|
||||||
- name: Upload
|
# - name: Upload
|
||||||
uses: shogo82148/actions-upload-release-asset@v1
|
# uses: shogo82148/actions-upload-release-asset@v1
|
||||||
with:
|
# with:
|
||||||
upload_url: ${{ needs.release.outputs.upload_url }}
|
# upload_url: ${{ needs.release.outputs.upload_url }}
|
||||||
asset_path: ui/flutter/dist/*
|
# asset_path: ui/flutter/dist/*
|
||||||
overwrite: true
|
# overwrite: true
|
||||||
build-web:
|
# build-web:
|
||||||
runs-on: ubuntu-latest
|
# runs-on: ubuntu-latest
|
||||||
needs: [ release ]
|
# needs: [ release ]
|
||||||
steps:
|
# steps:
|
||||||
- uses: actions/checkout@v3
|
# - uses: actions/checkout@v3
|
||||||
- uses: actions/setup-go@v3
|
# - uses: actions/setup-go@v3
|
||||||
with:
|
# with:
|
||||||
go-version: '^1.19'
|
# go-version: '^1.19'
|
||||||
cache: true
|
# cache: true
|
||||||
- uses: subosito/flutter-action@v2
|
# - uses: subosito/flutter-action@v2
|
||||||
- name: Build
|
# - name: Build
|
||||||
env:
|
# env:
|
||||||
VERSION: ${{ needs.release.outputs.tag_name }}
|
# VERSION: ${{ needs.release.outputs.tag_name }}
|
||||||
run: |
|
# run: |
|
||||||
cd ui/flutter
|
# cd ui/flutter
|
||||||
flutter build web
|
# flutter build web
|
||||||
cd ../../
|
# cd ../../
|
||||||
cp -r ui/flutter/build/web cmd/web/dist
|
# cp -r ui/flutter/build/web cmd/web/dist
|
||||||
mkdir -p dist/zip
|
# mkdir -p dist/zip
|
||||||
goos_arr=(windows darwin linux)
|
# goos_arr=(windows darwin linux)
|
||||||
goarch_arr=(386 amd64 arm64)
|
# goarch_arr=(386 amd64 arm64)
|
||||||
export CGO_ENABLED=0
|
# export CGO_ENABLED=0
|
||||||
for goos in "${goos_arr[@]}"; do
|
# for goos in "${goos_arr[@]}"; do
|
||||||
for goarch in "${goarch_arr[@]}"; do
|
# for goarch in "${goarch_arr[@]}"; do
|
||||||
name=gopeed-web-$VERSION-$goos-$goarch
|
# name=gopeed-web-$VERSION-$goos-$goarch
|
||||||
dir="dist/$name/"
|
# dir="dist/$name/"
|
||||||
(GOOS=$goos GOARCH=$goarch go build -tags nosqlite,web -ldflags="-s -w" -o $dir github.com/monkeyWie/gopeed/cmd/web \
|
# (GOOS=$goos GOARCH=$goarch go build -tags nosqlite,web -ldflags="-s -w" -o $dir github.com/monkeyWie/gopeed/cmd/web \
|
||||||
&& cd $dir \
|
# && cd $dir \
|
||||||
&& file=$(ls -AU | head -1) \
|
# && file=$(ls -AU | head -1) \
|
||||||
&& mkdir $name \
|
# && mkdir $name \
|
||||||
&& mv $file $name/$(echo $file | sed -e "s/web/gopeed/g") \
|
# && mv $file $name/$(echo $file | sed -e "s/web/gopeed/g") \
|
||||||
&& zip -r ../zip/$name.zip * \
|
# && zip -r ../zip/$name.zip * \
|
||||||
&& cd ../..) \
|
# && cd ../..) \
|
||||||
|| true
|
# || true
|
||||||
done
|
# done
|
||||||
done
|
# done
|
||||||
- name: Upload
|
# - name: Upload
|
||||||
uses: shogo82148/actions-upload-release-asset@v1
|
# uses: shogo82148/actions-upload-release-asset@v1
|
||||||
with:
|
# with:
|
||||||
upload_url: ${{ needs.release.outputs.upload_url }}
|
# upload_url: ${{ needs.release.outputs.upload_url }}
|
||||||
asset_path: dist/zip/*
|
# asset_path: dist/zip/*
|
||||||
overwrite: true
|
# overwrite: true
|
||||||
Reference in new issue
Block a user