Skip to content

Commit

Permalink
[Fix] resolve conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
canxin121 committed Nov 10, 2024
1 parent 5512924 commit 5cbbd05
Show file tree
Hide file tree
Showing 7 changed files with 332 additions and 326 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -320,4 +320,4 @@ jobs:
with:
name: AppRhyme_macos_unknown_${{ needs.get_version.outputs.app_version }}_dmg
path: ./dist/${{ needs.get_version.outputs.app_version }}/AppRhyme_macos_unknown_${{ needs.get_version.outputs.app_version }}.dmg
compression-level: 9
compression-level: 9
18 changes: 4 additions & 14 deletions .github/workflows/build_android_apks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,18 @@ jobs:
name: Build and Push Android APKs
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

# Step 2: Fetch version from pubspec.yaml and set tag variable
- name: Set version var
id: vars
run: |
sudo snap install yq
app_version=$(yq eval '.version' pubspec.yaml)
echo "app_version=$app_version" >> $GITHUB_OUTPUT
# Step 3: Set up signing files for APK
- name: Set up signing files
env:
APK_SIGN_PWD: "${{ secrets.APK_SIGN_PWD }}"
Expand All @@ -31,7 +28,6 @@ jobs:
chmod a+x tools/generate_jks_linux_amd64
tools/generate_jks_linux_amd64
# Step 4: Replace keys in the project
- name: Replace key
env:
SOME_SECRET_KEY: ${{ secrets.SOME_SECRET_KEY }}
Expand All @@ -41,62 +37,56 @@ jobs:
chmod a+x tools/key_replace_linux_amd64
tools/key_replace_linux_amd64
# Step 5: Install Rust (if required for build)
- name: Install Rust
uses: dtolnay/rust-toolchain@stable

# Step 6: Set up Java (required for Flutter build)
- uses: actions/setup-java@v4
with:
distribution: 'oracle'
java-version: '17'

# Step 7: Set up Flutter
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable

# Step 8: Build APK
- name: Build APK
run: flutter build apk --release

- name: Build APK (split per ABI)
run: flutter build apk --release --split-per-abi

# Step 9: Rename APKs with version and commit SHA
- name: Rename APKs
run: |
mv build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/AppRhyme_android_${{ steps.vars.outputs.app_version }}_unknown.apk
mv build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk build/app/outputs/flutter-apk/AppRhyme_android_${{ steps.vars.outputs.app_version }}_armeabi-v7a.apk
mv build/app/outputs/flutter-apk/app-arm64-v8a-release.apk build/app/outputs/flutter-apk/AppRhyme_android_${{ steps.vars.outputs.app_version }}_arm64-v8a.apk
mv build/app/outputs/flutter-apk/app-x86_64-release.apk build/app/outputs/flutter-apk/AppRhyme_android_${{ steps.vars.outputs.app_version }}_x86_64.apk
# Step 10: Upload APKs as artifacts
- name: Upload APK (unknown)
uses: actions/upload-artifact@v4
with:
name: AppRhyme_android_unknown
name: AppRhyme_android_unknown_${{ steps.vars.outputs.app_version }}
path: build/app/outputs/flutter-apk/AppRhyme_android_${{ steps.vars.outputs.app_version }}_unknown.apk
compression-level: 9

- name: Upload APK (armeabi-v7a)
uses: actions/upload-artifact@v4
with:
name: AppRhyme_android_armeabi-v7a
name: AppRhyme_android_armeabi-v7a_${{ steps.vars.outputs.app_version }}
path: build/app/outputs/flutter-apk/AppRhyme_android_${{ steps.vars.outputs.app_version }}_armeabi-v7a.apk
compression-level: 9

- name: Upload APK (arm64-v8a)
uses: actions/upload-artifact@v4
with:
name: AppRhyme_android_arm64-v8a
name: AppRhyme_android_arm64-v8a_${{ steps.vars.outputs.app_version }}
path: build/app/outputs/flutter-apk/AppRhyme_android_${{ steps.vars.outputs.app_version }}_arm64-v8a.apk
compression-level: 9

- name: Upload APK (x86_64)
uses: actions/upload-artifact@v4
with:
name: AppRhyme_android_x86_64
name: AppRhyme_android_x86_64_${{ steps.vars.outputs.app_version }}
path: build/app/outputs/flutter-apk/AppRhyme_android_${{ steps.vars.outputs.app_version }}_x86_64.apk
compression-level: 9
20 changes: 10 additions & 10 deletions .github/workflows/build_ios_ipa.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Build Ios Ipa
name: Build Ios Ipa
on:
workflow_dispatch:

jobs:
get_version:
runs-on: ubuntu-latest
Expand All @@ -18,10 +18,10 @@ jobs:
run: |
sudo snap install yq
app_version=$(yq eval '.version' pubspec.yaml)
echo "::set-output name=app_version::$app_version"
echo "app_version=$app_version" >> $GITHUB_OUTPUT
build_and_push:
name: Build and Push Ios Ipa
name: Build and Push Ios Ipa
needs: get_version
runs-on: macos-latest
steps:
Expand All @@ -36,7 +36,7 @@ jobs:
SOME_REPLACE_KEY: ${{ secrets.SOME_REPLACE_KEY }}
SOME_REPLACE_FILE: ${{ secrets.SOME_REPLACE_FILE }}
run: |
chmod a+x tools/key_replace_macox_unknown
chmod a+x tools/key_replace_macox_unknown
tools/key_replace_macox_unknown
- name: Install Rust
Expand All @@ -45,9 +45,9 @@ jobs:
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
channel: stable

- name: Flutter Build Ios
- name: Flutter Build Ios
run: |-
flutter build ios --release --no-codesign --verbose
Expand All @@ -65,6 +65,6 @@ jobs:
- name: Upload AppImage Package
uses: actions/upload-artifact@v4
with:
name: AppRhyme_ios_unknown_${{ needs.get_version.outputs.app_version }}_ipa
path: AppRhyme_ios_unknown_${{ needs.get_version.outputs.app_version }}.ipa
compression-level: 9
name: AppRhyme_ios_unknown_${{ needs.get_version.outputs.app_version }}_ipa
path: AppRhyme_ios_unknown_${{ needs.get_version.outputs.app_version }}.ipa
compression-level: 9
6 changes: 3 additions & 3 deletions .github/workflows/build_macos_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:
uses: actions/checkout@v4
with:
submodules: true

- name: Fetch Version
id: fetch_version
run: |
sudo snap install yq
app_version=$(yq eval '.version' pubspec.yaml)
echo "::set-output name=app_version::$app_version"
echo "app_version=$app_version" >> $GITHUB_OUTPUT
build_and_push:
name: Build and Push Macos Packages
Expand Down Expand Up @@ -70,4 +70,4 @@ jobs:
with:
name: AppRhyme_macos_unknown_${{ needs.get_version.outputs.app_version }}_dmg
path: ./dist/${{ needs.get_version.outputs.app_version }}/AppRhyme_macos_unknown_${{ needs.get_version.outputs.app_version }}.dmg
compression-level: 9
compression-level: 9
25 changes: 9 additions & 16 deletions .github/workflows/build_windows_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
run: |
sudo snap install yq
app_version=$(yq eval '.version' pubspec.yaml)
echo "::set-output name=app_version::$app_version"
echo "app_version=$app_version" >> $GITHUB_OUTPUT
build_and_push:
name: Build and Push Windows Packages
needs: get_version
Expand All @@ -40,10 +40,10 @@ jobs:
shell: pwsh

- name: Setup Inno Setup 6
shell: pwsh
run: |-
winget install --id JRSoftware.InnoSetup -e --silent --accept-package-agreements --accept-source-agreements
Copy-Item "./tools/ChineseSimplified.isl" -Destination "C:\Program Files (x86)\Inno Setup 6\Languages"
tools/innosetup-6.3.3.exe /VERYSILENT
shell: pwsh

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
Expand All @@ -56,23 +56,16 @@ jobs:
- name: Distribute Packages
run: |
dart pub global activate --source git https://github.com/canxin121/flutter_distributor --git-ref temp --git-path packages/flutter_distributor
flutter_distributor package --platform windows --targets msix,exe
flutter_distributor package --platform windows --targets exe
shell: pwsh

- name: Rename Packages
- name: Rename Packages
run: |
mv ./dist/${{ needs.get_version.outputs.app_version }}/*.msix ./dist/${{ needs.get_version.outputs.app_version }}/AppRhyme_windows_${{ needs.get_version.outputs.app_version }}_x86-64.msix
mv ./dist/${{ needs.get_version.outputs.app_version }}/*.exe ./dist/${{ needs.get_version.outputs.app_version }}/AppRhyme_windows_${{ needs.get_version.outputs.app_version }}_x86-64.exe
- name: Upload msix Package
uses: actions/upload-artifact@v4
with:
name: AppRhyme_windows_${{ needs.get_version.outputs.app_version }}_x86-64_msix
path: dist/${{ needs.get_version.outputs.app_version }}/AppRhyme_windows_${{ needs.get_version.outputs.app_version }}_x86-64.msix
compression-level: 9

- name: Upload exe Package
uses: actions/upload-artifact@v4
with:
name: AppRhyme_windows_${{ needs.get_version.outputs.app_version }}_x86-64_exe
path: dist/${{ needs.get_version.outputs.app_version }}/AppRhyme_windows_${{ needs.get_version.outputs.app_version }}_x86-64.exe
compression-level: 9
compression-level: 9
Loading

0 comments on commit 5cbbd05

Please sign in to comment.