ci: build windows

This commit is contained in:
liwei committed 2022-11-02 21:58:34 +08:00
1 parent 39aec19471
commit be75b50521
7 files changed
+126 -41

No files matched your search

+75 -34
View File
@@ -25,39 +25,81 @@ jobs:
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# build-cli:
# runs-on: ubuntu-latest
# needs: [ release ]
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-go@v3
# with:
# go-version: '^1.19'
# cache: true
# - name: Build
# env:
# VERSION: ${{ needs.release.outputs.tag_name }}
# run: |
# mkdir -p dist/zip
# goos_arr=(windows darwin linux)
# goarch_arr=(386 amd64 arm64)
# export CGO_ENABLED=0
# for goos in "${goos_arr[@]}"; do
# for goarch in "${goarch_arr[@]}"; do
# dir="dist/gopeed-$VERSION-$goos-$goarch/"
# (GOOS=$goos GOARCH=$goarch go build -tags nosqlite -ldflags="-s -w" -o $dir github.com/monkeyWie/gopeed/cmd/gopeed \
# && cd $dir \
# && zip -r ../zip/gopeed-cli-$VERSION-$goos-$goarch.zip * \
# && cd ../..) \
# || true
# done
# done
# - name: Upload
# uses: shogo82148/actions-upload-release-asset@v1
# with:
# upload_url: ${{ needs.release.outputs.upload_url }}
# asset_path: dist/zip/*
# overwrite: true
build-windows:
runs-on: windows-latest
needs: [ release ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '^1.19'
cache: true
- uses: subosito/flutter-action@v2
- name: Build
env:
VERSION: ${{ needs.release.outputs.tag_name }}
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
cd build/windows
echo @"
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "Gopeed"
#define MyAppVersion "$env:VERSION.substring(1)"
#define MyAppPublisher "monkeyWie"
#define MyAppURL "https://gopeed.com"
#define MyAppExeName "gopeed.exe"
[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{5960F34D-1E42-402C-8C85-DE2FF24CBAE4}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\gopeed
DisableProgramGroupPage=yes
LicenseFile=..\..\..\..\LICENSE
; Remove the following line to run in administrative install mode (install for all users.)
PrivilegesRequired=lowest
OutputBaseFilename=gopeed
SetupIconFile=..\..\assets\icon\icon.ico
Compression=lzma
SolidCompression=yes
WizardStyle=modern
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: ".\runner\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
"@ > setup.iss
"%programfiles(x86)%\Inno Setup 6\iscc.exe" "setup.iss"
mv "Output\setup.exe" "gopeed-$env:VERSION-windows-amd64.exe"
- name: Upload
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ui/flutter/build/windows/Output/*
overwrite: true
build-macos-arm64-lib:
runs-on: ubuntu-latest
needs: [ release ]
@@ -114,7 +156,6 @@ jobs:
PROJECT_DIR=$(pwd)
cd ui/flutter
flutter config --enable-macos-desktop
flutter build macos
cd build/macos/Build/Products/Release
cat>appdmg.json<<EOF