ci: debug windows

This commit is contained in:
liwei committed 2022-11-03 22:18:15 +08:00
1 parent 08ffb51946
commit cebdda564e
2 files changed
+224 -221

No files matched your search

+2 -2
View File
@@ -1,5 +1,5 @@
name-template: 'v1.0.0 🌈' name-template: 'v$NEXT_PATCH_VERSION 🌈'
tag-template: 'v1.0.0' tag-template: 'v$NEXT_PATCH_VERSION'
categories: categories:
- title: '🆕 Features' - title: '🆕 Features'
labels: labels:
+222 -219
View File
@@ -29,16 +29,19 @@ jobs:
runs-on: windows-latest runs-on: windows-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: |
Get-ChildItem -Path c:\ -Recurse –Include msvcp140.dll
Get-ChildItem -Path c:\ -Recurse –Include vcruntime140.dll
exit 0
go build -tags nosqlite -ldflags="-w -s" -buildmode=c-shared -o ui/flutter/windows/libgopeed.dll github.com/monkeyWie/gopeed/bind/desktop 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 cd ui/flutter
flutter build windows flutter build windows
@@ -54,7 +57,7 @@ jobs:
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "Gopeed" #define MyAppName "Gopeed"
#define MyAppVersion "$($env:PATH.substring(1))" #define MyAppVersion "$($env:VERSION.substring(1))"
#define MyAppPublisher "monkeyWie" #define MyAppPublisher "monkeyWie"
#define MyAppURL "https://gopeed.com" #define MyAppURL "https://gopeed.com"
#define MyAppExeName "gopeed.exe" #define MyAppExeName "gopeed.exe"
@@ -106,219 +109,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