Skip to content

Commit

Permalink
[Action] Update Release Action.
Browse files Browse the repository at this point in the history
  • Loading branch information
canxin121 committed May 5, 2024
1 parent 8751f15 commit 794303b
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 65 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@ jobs:
run: flutter build windows --release --verbose

- name: Package Executable
run: 7z a -r -sse "..\..\..\..\..\build\app\AppRhyme-release-amd64.zip" *
run: 7z a -r -sse "..\..\..\..\..\build\app\AppRhyme-win-release-amd64.zip" *
working-directory: build\windows\x64\runner\Release

- name: Upload files
uses: actions/upload-artifact@v4
with:
name: AppRhyme-release-amd64
path: build/app/AppRhyme-release-amd64.zip
name: AppRhyme-win-release-amd64
path: build/app/AppRhyme-win-release-amd64.zip

- name: Flutter build apk
run: flutter build apk --release --split-per-abi --verbose
Expand Down
139 changes: 77 additions & 62 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: "Release"
name: "BUILD"
on:
workflow_dispatch:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"

jobs:
build_on_macos:
runs-on: macos-latest
Expand Down Expand Up @@ -32,16 +30,13 @@ jobs:
mkdir -p Payload
mv ./build/ios/iphoneos/Runner.app Payload
zip -r -y Payload.zip Payload/Runner.app
mv Payload.zip AppRhyme-ios-release-unknown.ipa
- name: Flutter build macos
run: flutter build macos --release --verbose
mv Payload.zip AppRhyme.ipa
- name: Upload IPA
uses: actions/upload-artifact@v4
with:
name: AppRhyme-ios-release-unknown.ipa
path: AppRhyme-ios-release-unknown.ipa
name: AppRhyme.ipa
path: AppRhyme.ipa
compression-level: 9

- name: Release Ios
Expand All @@ -52,14 +47,23 @@ jobs:
tag_name: ${{ github.event.inputs.tag_name }}
token: ${{ secrets.RELEASE_TOKEN }}

- name: Flutter build macos
run: flutter build macos --release --verbose

- name: Upload Macos app
uses: actions/upload-artifact@v4
with:
name: AppRhyme-macos-release-unknown.zip
path: build/macos/Build/Products/Release/*.app


- name: Install tree
run: brew install tree

- name: Print directory tree
run: tree build/macos/Build/Products/

- name: Package Executable
run: |
run:
mkdir -p build/app/
zip -r "build/app/AppRhyme-macos-release-unknown.zip" "build/macos/Build/Products/Release/AppRhyme.app"

Expand All @@ -76,37 +80,27 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- uses: subosito/flutter-action@v2
with:
channel: "beta"

- name: Install Flutter Dependency
run: flutter pub get

- name: Install Rust
uses: dtolnay/rust-toolchain@stable


- name: Install Linux dependency
run: |
sudo apt-get update -y
sudo apt install libwebkit2gtk-4.1-dev
sudo apt-get install -y ninja-build libgtk-3-dev
sudo apt-get install libasound2-dev
- name: Flutter build linux
run: flutter build linux --release --verbose

- name: Flutter build apk
run: flutter build apk --release --split-per-abi --verbose

- name: Package Executable
run: 7z a -r "../../../../../build/app/AppRhyme-linux-release-amd64.zip" *
working-directory: build/linux/x64/release/bundle
Expand All @@ -125,6 +119,63 @@ jobs:
tag_name: ${{ github.event.inputs.tag_name }}
token: ${{ secrets.RELEASE_TOKEN }}

build_on_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- uses: subosito/flutter-action@v2
with:
channel: "beta"

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Install Flutter Dependency
run: flutter pub get

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Install Cargo-Ndk
run: cargo install cargo-ndk --version 2.11.0 --force

- name: Install android ndk
uses: nttld/setup-ndk@v1
id: install-ndk
with:
ndk-version: r22b

- name: Flutter build windows
run: flutter build windows --release --verbose

- name: Package Executable
run: 7z a -r -sse "..\..\..\..\..\build\app\AppRhyme-win-release-amd64.zip" *
working-directory: build\windows\x64\runner\Release

- name: Upload files
uses: actions/upload-artifact@v4
with:
name: AppRhyme-win-release-amd64
path: build/app/AppRhyme-win-release-amd64.zip

- name: Release Windows
uses: softprops/action-gh-release@v1
with:
files: build/app/AppRhyme-win-release-amd64.zip
prerelease: false
tag_name: ${{ github.event.inputs.tag_name }}
token: ${{ secrets.RELEASE_TOKEN }}

- name: Flutter build apk
run: flutter build apk --release --split-per-abi --verbose

- name: Upload APK1
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -161,40 +212,4 @@ jobs:
build/app/outputs/apk/release/AppRhyme-x86_64-release.apk
prerelease: false
tag_name: ${{ github.event.inputs.tag_name }}
token: ${{ secrets.RELEASE_TOKEN }}

build_on_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- uses: subosito/flutter-action@v2
with:
channel: "beta"

- name: Install Flutter Dependency
run: flutter pub get

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Flutter build windows
run: flutter build windows --release --verbose

- name: Package Executable
run: 7z a -r -sse "..\..\..\..\..\build\app\AppRhyme-win-release-amd64.zip" *
working-directory: build\windows\x64\runner\Release

- name: Upload files
uses: actions/upload-artifact@v4
with:
name: AppRhyme-release-amd64
path: build/app/AppRhyme-win-release-amd64.zip

- name: Release
uses: softprops/action-gh-release@v1
with:
files: build/app/AppRhyme-win-release-amd64.zip
prerelease: false
tag_name: ${{ github.event.inputs.tag_name }}
token: ${{ secrets.RELEASE_TOKEN }}
token: ${{ secrets.RELEASE_TOKEN }}

0 comments on commit 794303b

Please sign in to comment.