From 2294638185aae9f410bcb7291729d1261e5b1173 Mon Sep 17 00:00:00 2001 From: Juan Gilsanz Polo Date: Sat, 27 May 2023 01:50:29 +0200 Subject: [PATCH] Fixed sed and changed dmg --- .github/workflows/release.yaml | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index aa021e4..0de3945 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -58,32 +58,41 @@ jobs: build-and-release-macos: name: Build macOS runs-on: macos-latest + env: + MACOS_APP_RELEASE_PATH: build/macos/Build/Products/Release steps: - uses: actions/checkout@v3 - name: Decode .env run: echo "${{ secrets.ENV }}" | base64 --decode > .env - name: Update version in YAML - run: sed -i 's/99.99.99+99/${{ github.event.inputs.version }}+${{ github.event.inputs.number }}/g' pubspec.yaml + run: sed -i '' 's/99.99.99+99/${{ github.event.inputs.version }}+${{ github.event.inputs.number }}/g' pubspec.yaml - uses: subosito/flutter-action@v1 with: channel: "stable" - run: flutter clean - run: flutter pub get - run: flutter build macos --release - - name: Get into Release directory - run: cd build/macos/Build/Products/Release - - name: Create folder to build dmg - run: mkdir AdGuard\ Home\ Manager - - name: Copy app into folder - run: cp -r ./AdGuard\ Home\ Manager.app ./AdGuard\ Home\ Manager/AdGuard\ Home\ Manager.app - - name: Generate symbolic link to Applications dir - run: ln -s /Applications AdGuard\ Home\ Manager - - name: Generate dmg - run: hdiutil create -srcfolder AdGuard\ Home\ Manager AdGuardHomeManager_${{ github.event.inputs.version }}_macOS_Universal.dmg + - name: Create a dmg + run: | + echo "Install create-dmg" + brew install create-dmg + cd $MACOS_APP_RELEASE_PATH + create-dmg \ + --volname "AdGuard Home Manager" \ + --window-pos 200 120 \ + --window-size 800 529 \ + --icon-size 130 \ + --text-size 14 \ + --icon "AdGuard Home Manager.app" 260 250 \ + --hide-extension "AdGuard Home Manager.app" \ + --app-drop-link 540 250 \ + --hdiutil-quiet \ + "AdGuardHomeManager_${{ github.event.inputs.version }}_macOS_Universal.dmg" \ + AdGuard Home Manager.app" - name: Create a Release in GitHub uses: ncipollo/release-action@v1 with: - artifacts: "AdGuardHomeManager_${{ github.event.inputs.version }}_macOS_Universal.dmg" + artifacts: "$MACOS_APP_RELEASE_PATH/AdGuardHomeManager_${{ github.event.inputs.version }}_macOS_Universal.dmg" token: ${{ secrets.GH_TOKEN }} tag: ${{ github.event.inputs.version }} commit: ${{ github.sha }} \ No newline at end of file