From ccb9f974eacd623311d70dc3d311a3185175963e Mon Sep 17 00:00:00 2001 From: deltamaya Date: Tue, 29 Oct 2024 07:59:51 +0800 Subject: [PATCH] macos build action --- .github/workflows/main.yml | 78 +++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6ffa558..6e538fd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,6 +3,45 @@ run-name: Build IOS on: workflow_dispatch: {} jobs: + Build_MacOS: + runs-on: macos-13 + steps: + - uses: actions/checkout@v3 + - uses: subosito/flutter-action@v2 + with: + channel: "stable" + flutter-version-file: pubspec.yaml + architecture: aarch64 + - run: sudo xcode-select --switch /Applications/Xcode_14.3.1.app + - run: flutter pub get + # Step 1: Decode and install the certificate + - name: Decode and install certificate + env: + CERTIFICATE: ${{ secrets.CERTIFICATE˚ }} + CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }} + run: | + echo "$CERTIFICATE" | base64 --decode > signing_certificate.p12 + security import signing_certificate.p12 -k ~/Library/Keychains/login.keychain -P "$CERTIFICATE_PASSWORD" -T /usr/bin/codesign + + # Step 2: Build the Flutter macOS app + - name: Build Flutter macOS App + run: flutter build macos --release + + + # Step 4: Create the DMG file + - name: Create DMG + run: | + mkdir -p dist + hdiutil create -volname "venera" -srcfolder build/macos/Build/Products/Release/venera.app -ov -format UDZO "dist/venera.dmg" + + + + # Step 8: Attach and upload artifacts (optional) + - name: Upload DMG + uses: actions/upload-artifact@v3 + with: + name: venera.dmg + path: dist/venera.dmg Build_IOS: runs-on: macos-13 steps: @@ -24,42 +63,3 @@ jobs: with: name: app-ios.ipa path: /Users/runner/work/venera/venera/build/ios/iphoneos/venera-ios.ipa - Build_MacOS: - runs-on: macos-13 - steps: - - uses: actions/checkout@v3 - - uses: subosito/flutter-action@v2 - with: - channel: "stable" - flutter-version-file: pubspec.yaml - architecture: arm64 - - run: sudo xcode-select --switch /Applications/Xcode_14.3.1.app - - run: flutter pub get - # Step 1: Decode and install the certificate - - name: Decode and install certificate - env: - CERTIFICATE: ${{ secrets.CERTIFICATE }} - CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }} - run: | - echo "$CERTIFICATE" | base64 --decode > signing_certificate.p12 - security import signing_certificate.p12 -k ~/Library/Keychains/login.keychain -P "$CERTIFICATE_PASSWORD" -T /usr/bin/codesign - - # Step 2: Build the Flutter macOS app - - name: Build Flutter macOS App - run: flutter build macos --release --dart-define=FLUTTER_ARCH=arm64 - - - # Step 4: Create the DMG file - - name: Create DMG - run: | - mkdir -p dist - hdiutil create -volname "venera" -srcfolder build/macos/Build/Products/Release/venera.app -ov -format UDZO "dist/venera.dmg" - - - - # Step 8: Attach and upload artifacts (optional) - - name: Upload DMG - uses: actions/upload-artifact@v3 - with: - name: venera.dmg - path: dist/venera.dmg