-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add all platform icon and change apk package name
- Loading branch information
Showing
1 changed file
with
119 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,119 +1,119 @@ | ||
name: Build and Release Flutter App | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: [windows, linux, android] | ||
include: | ||
- platform: windows | ||
os: windows-latest | ||
build-command: flutter build windows --release | ||
artifact-path: build/windows/x64/runner/Release | ||
artifact-name: clsswjz-windows-x64 | ||
ext: .zip | ||
- platform: linux | ||
os: ubuntu-latest | ||
build-command: flutter build linux --release | ||
artifact-path: build/linux/x64/release/bundle | ||
artifact-name: clsswjz-linux-x64 | ||
ext: .zip | ||
- platform: android | ||
os: ubuntu-latest | ||
build-command: flutter build apk --release --no-tree-shake-icons | ||
artifact-path: build/app/outputs/flutter-apk/app-release.apk | ||
artifact-name: clsswjz-android-arm64 | ||
ext: .apk | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Java | ||
if: matrix.platform == 'android' | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
|
||
- name: Setup Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: '3.24.5' | ||
channel: 'stable' | ||
|
||
- name: Install Linux dependencies | ||
if: matrix.platform == 'linux' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y ninja-build libgtk-3-dev | ||
- name: Get dependencies | ||
run: flutter pub get | ||
|
||
- name: Build ${{ matrix.platform }} | ||
run: ${{ matrix.build-command }} | ||
|
||
- name: Create ZIP (Windows) | ||
if: matrix.platform == 'windows' | ||
run: | | ||
cd build/windows/x64/runner/Release | ||
7z a ../../../../../${{ matrix.artifact-name }}${{ matrix.ext }} * | ||
- name: Create ZIP (Linux) | ||
if: matrix.platform == 'linux' | ||
run: | | ||
cd build/linux/x64/release/bundle | ||
zip -r ../../../../../${{ matrix.artifact-name }}${{ matrix.ext }} * | ||
- name: Rename Android APK | ||
if: matrix.platform == 'android' | ||
run: | | ||
mv build/app/outputs/flutter-apk/app-release.apk ${{ matrix.artifact-name }}${{ matrix.ext }} | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ matrix.artifact-name }} | ||
path: ${{ matrix.artifact-name }}${{ matrix.ext }} | ||
|
||
release: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download all artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
path: artifacts | ||
|
||
- name: List artifacts | ||
run: ls -R artifacts/ | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
artifacts/clsswjz-android-arm64/clsswjz-android-arm64.apk | ||
artifacts/clsswjz-windows-x64/clsswjz-windows-x64.zip | ||
artifacts/clsswjz-linux-x64/clsswjz-linux-x64.zip | ||
draft: false | ||
prerelease: false | ||
name: Release ${{ github.ref_name }} | ||
body: | | ||
Release ${{ github.ref_name }} | ||
Automated release for: | ||
- Windows (x64): clsswjz-windows-x64.zip | ||
- Linux (x64): clsswjz-linux-x64.zip | ||
- Android (arm64): clsswjz-android-arm64.apk | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
name: Build and Release Flutter App | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: [windows, linux, android] | ||
include: | ||
- platform: windows | ||
os: windows-latest | ||
build-command: flutter build windows --release | ||
artifact-path: build/windows/x64/runner/Release | ||
artifact-name: clsswjz-${{ github.ref_name }}-windows-x64 | ||
ext: .zip | ||
- platform: linux | ||
os: ubuntu-latest | ||
build-command: flutter build linux --release | ||
artifact-path: build/linux/x64/release/bundle | ||
artifact-name: clsswjz-${{ github.ref_name }}-linux-x64 | ||
ext: .zip | ||
- platform: android | ||
os: ubuntu-latest | ||
build-command: flutter build apk --release --no-tree-shake-icons | ||
artifact-path: build/app/outputs/flutter-apk/app-release.apk | ||
artifact-name: clsswjz-${{ github.ref_name }}-android-arm64 | ||
ext: .apk | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Java | ||
if: matrix.platform == 'android' | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
|
||
- name: Setup Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: '3.24.5' | ||
channel: 'stable' | ||
|
||
- name: Install Linux dependencies | ||
if: matrix.platform == 'linux' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y ninja-build libgtk-3-dev | ||
- name: Get dependencies | ||
run: flutter pub get | ||
|
||
- name: Build ${{ matrix.platform }} | ||
run: ${{ matrix.build-command }} | ||
|
||
- name: Create ZIP (Windows) | ||
if: matrix.platform == 'windows' | ||
run: | | ||
cd build/windows/x64/runner/Release | ||
7z a ../../../../../${{ matrix.artifact-name }}${{ matrix.ext }} * | ||
- name: Create ZIP (Linux) | ||
if: matrix.platform == 'linux' | ||
run: | | ||
cd build/linux/x64/release/bundle | ||
zip -r ../../../../../${{ matrix.artifact-name }}${{ matrix.ext }} * | ||
- name: Rename Android APK | ||
if: matrix.platform == 'android' | ||
run: | | ||
mv build/app/outputs/flutter-apk/app-release.apk ${{ matrix.artifact-name }}${{ matrix.ext }} | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ matrix.artifact-name }} | ||
path: ${{ matrix.artifact-name }}${{ matrix.ext }} | ||
|
||
release: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download all artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
path: artifacts | ||
|
||
- name: List artifacts | ||
run: ls -R artifacts/ | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
artifacts/clsswjz-${{ github.ref_name }}-android-arm64/clsswjz-${{ github.ref_name }}-android-arm64.apk | ||
artifacts/clsswjz-${{ github.ref_name }}-windows-x64/clsswjz-${{ github.ref_name }}-windows-x64.zip | ||
artifacts/clsswjz-${{ github.ref_name }}-linux-x64/clsswjz-${{ github.ref_name }}-linux-x64.zip | ||
draft: false | ||
prerelease: false | ||
name: Release ${{ github.ref_name }} | ||
body: | | ||
Release ${{ github.ref_name }} | ||
Automated release for: | ||
- Windows (x64): clsswjz-${{ github.ref_name }}-windows-x64.zip | ||
- Linux (x64): clsswjz-${{ github.ref_name }}-linux-x64.zip | ||
- Android (arm64): clsswjz-${{ github.ref_name }}-android-arm64.apk | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |