Merge pull request #1 from RobertMeow/dev

Поддержка на Windows
This commit is contained in:
Robert
2024-01-21 00:23:06 +09:00
committed by GitHub
8 changed files with 150 additions and 0 deletions

147
.github/workflows/dev.yml vendored Normal file
View File

@@ -0,0 +1,147 @@
name: Flutter Multi-Platform Build and PreRelease
on:
push:
branches:
- dev
pull_request:
branches:
- dev
jobs:
build-android:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
- name: Set up Flutter
uses: subosito/flutter-action@v2.12.0
with:
channel: 'stable'
- name: Install dependencies
run: flutter pub get
- name: Build APK
run: flutter build apk --release
- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: android-apk
path: build/app/outputs/flutter-apk/app-release.apk
build-ios:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
architecture: x64
- run: flutter pub get
- run: flutter build ios --release --no-codesign
- name: Upload iOS build
uses: actions/upload-artifact@v4
with:
name: ios-build
path: build/ios/iphoneos/*.app
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- run: flutter config --enable-windows-desktop
- run: flutter build windows --release
- name: Copy DLL files
run: |
Copy-Item windows/dll/msvcp140.dll build/windows/x64/runner/Release/
Copy-Item windows/dll/vcruntime140.dll build/windows/x64/runner/Release/
Copy-Item windows/dll/vcruntime140_1.dll build/windows/x64/runner/Release/
- name: Zip Windows build
run: Compress-Archive -Path build/windows/x64/runner/Release/* -DestinationPath windows-build.zip
- name: Upload Windows build
uses: actions/upload-artifact@v4
with:
name: windows-build
path: windows-build.zip
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev
- run: flutter config --enable-linux-desktop
- run: flutter build linux
- name: Zip Linux build
run: zip -r linux-build.zip build/linux/x64/release/
- name: Upload Linux build
uses: actions/upload-artifact@v4
with:
name: linux-build
path: linux-build.zip
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
architecture: x64
- run: flutter config --enable-macos-desktop
- name: Install tools
run: brew install automake libtool create-dmg
- name: Build macOS
run: flutter build macos --release
- name: Upload MacOS build
uses: actions/upload-artifact@v4
with:
name: macos-build
path: build/macos/Build/Products/Release/
create-prerelease:
needs: [ build-android, build-ios, build-windows, build-linux, build-macos ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
pubspec.yaml
sparse-checkout-cone-mode: false
- name: Get version
id: yq
uses: mikefarah/yq@master
with:
cmd: yq -r '.version' 'pubspec.yaml'
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release and Upload Artifacts
uses: ncipollo/release-action@v1.13.0
with:
artifacts: "android-apk/app-release.apk,windows-build/windows-build.zip,ios-build/*.ipa,linux-build/linux-build.zip,macos-build/*.dmg"
name: Release v${{ steps.yq.outputs.result }}
prerelease: true
token: ${{ secrets.GITHUB_TOKEN }}
commit: dev
tag: v${{ steps.yq.outputs.result }}.${{ github.run_number }}

View File

@@ -4,6 +4,9 @@ on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-android:

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.