Skip to content

Commit

Permalink
add all platform icon and change apk package name
Browse files Browse the repository at this point in the history
  • Loading branch information
clssw1004 committed Dec 11, 2024
1 parent e27b99e commit dd56ce6
Showing 1 changed file with 119 additions and 119 deletions.
238 changes: 119 additions & 119 deletions .github/workflows/flutter_build.yml
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 }}

0 comments on commit dd56ce6

Please sign in to comment.