Skip to content

Commit

Permalink
Improve macOS/iOS workflows, add builds to TestFlight (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
Foxushka authored Sep 10, 2023
1 parent 4cfa889 commit 0fde875
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 15 deletions.
52 changes: 45 additions & 7 deletions .github/workflows/publish-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ jobs:
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- run: sudo chown -R $USER . && sudo chmod -R a+rwx .
- name: Fix permissions
run: sudo chown -R $USER . && sudo chmod -R a+rwx .
- name: Enable macOS
run: flutter config --enable-macos-desktop
- name: Install tools
Expand All @@ -97,7 +98,7 @@ jobs:
base64-encoded-secret: ${{ secrets.APP_STORE_CERTIFICATE }}
filename: "cert_key"
working-directory: "./chameleonultragui"
- name: Build and upload executable
- name: Initialize keychain and certificates
working-directory: "./chameleonultragui"
run: |
export APP_STORE_CONNECT_PRIVATE_KEY=`cat AuthKey.p8`
Expand All @@ -106,11 +107,18 @@ jobs:
keychain initialize
keychain add-certificates
xcode-project use-profiles
- name: Build app
working-directory: "./chameleonultragui"
run: |
sudo chown -R $USER . && sudo chmod -R a+rwx .
flutter build macos --release --build-number ${{ github.run_number }} --build-name "1.0.${{ github.run_number }}"
sudo chown -R $USER . && sudo chmod -R a+rwx .
- name: Sign package
working-directory: "./chameleonultragui"
run: |
APP_NAME=$(find $(pwd) -name "*.app")
PACKAGE_NAME=$(basename "$APP_NAME" .app).pkg
echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV
xcrun productbuild --component "$APP_NAME" /Applications/ unsigned.pkg
INSTALLER_CERT_NAME=$(keychain list-certificates \
| jq '[.[]
Expand All @@ -120,17 +128,30 @@ jobs:
| xargs)
xcrun productsign --sign "$INSTALLER_CERT_NAME" unsigned.pkg "$PACKAGE_NAME"
sudo chown -R $USER . && sudo chmod -R a+rwx .
rm -f unsigned.pkg
- name: Upload package to App Store
working-directory: "./chameleonultragui"
run: |
export APP_STORE_CONNECT_PRIVATE_KEY=`cat AuthKey.p8`
app-store-connect publish --path "$PACKAGE_NAME"
while [[ -z "$BUILD_ID" ]]; do
BUILD_ID=$(app-store-connect list-builds --build-version-number ${{ github.run_number }} --processing-state VALID | grep -B 7 "Min os version: 10.14" | awk '/^Id:/ {print $2}')
export BUILD_ID=$(app-store-connect list-builds --build-version-number ${{ github.run_number }} --processing-state VALID | grep -B 7 "Min os version: 10.14" | awk '/^Id:/ {print $2}')
if [[ -z "$BUILD_ID" ]]; then
echo "Build is not ready, retrying in 5 seconds..."
sleep 5
fi
done
app-store-connect builds submit-to-testflight $BUILD_ID || true
echo "BUILD_ID=$BUILD_ID" >> $GITHUB_ENV
- name: Submit to App Store
working-directory: "./chameleonultragui"
run: |
export APP_STORE_CONNECT_PRIVATE_KEY=`cat AuthKey.p8`
app-store-connect builds submit-to-app-store --cancel-previous-submissions --platform=MAC_OS --version-string="1.0.${{ github.run_number }}" --whats-new="Compiled from `git log --pretty=format:%s --oneline --ancestry-path HEAD~1..HEAD`" --version-string="1.0.${{ github.run_number }}" $BUILD_ID
- name: Submit to TestFlight
working-directory: "./chameleonultragui"
run: |
export APP_STORE_CONNECT_PRIVATE_KEY=`cat AuthKey.p8`
app-store-connect builds submit-to-testflight $BUILD_ID || true
app-store-connect beta-groups add-build $BUILD_ID --beta-group="Open beta testing" || true
build-ios:
runs-on: macos-latest
env:
Expand Down Expand Up @@ -159,25 +180,42 @@ jobs:
base64-encoded-secret: ${{ secrets.APP_STORE_CERTIFICATE }}
filename: "cert_key"
working-directory: "./chameleonultragui"
- name: Build and upload executable
- name: Initialize keychain and certificates
working-directory: "./chameleonultragui"
run: |
export APP_STORE_CONNECT_PRIVATE_KEY=`cat AuthKey.p8`
app-store-connect fetch-signing-files $(xcode-project detect-bundle-id) --platform IOS --type IOS_APP_STORE --certificate-key=@file:cert_key --create
keychain initialize
keychain add-certificates
xcode-project use-profiles
- name: Build app
working-directory: "./chameleonultragui"
run: |
flutter build ipa --release --export-options-plist=$HOME/export_options.plist --build-number ${{ github.run_number }} --build-name "1.0.${{ github.run_number }}"
- name: Upload app to App Store
working-directory: "./chameleonultragui"
run: |
export APP_STORE_CONNECT_PRIVATE_KEY=`cat AuthKey.p8`
app-store-connect publish --path $(find $(pwd) -name "*.ipa")
while [[ -z "$BUILD_ID" ]]; do
BUILD_ID=$(app-store-connect list-builds --build-version-number ${{ github.run_number }} --processing-state VALID | grep -B 7 "Min os version: 11.0" | awk '/^Id:/ {print $2}')
export BUILD_ID=$(app-store-connect list-builds --build-version-number ${{ github.run_number }} --processing-state VALID | grep -B 7 "Min os version: 11.0" | awk '/^Id:/ {print $2}')
if [[ -z "$BUILD_ID" ]]; then
echo "Build is not ready, retrying in 30 seconds..."
sleep 30
fi
done
echo "BUILD_ID=$BUILD_ID" >> $GITHUB_ENV
- name: Submit to App Store
working-directory: "./chameleonultragui"
run: |
export APP_STORE_CONNECT_PRIVATE_KEY=`cat AuthKey.p8`
app-store-connect builds submit-to-app-store --cancel-previous-submissions --platform=IOS --version-string="1.0.${{ github.run_number }}" --whats-new="Compiled from `git log --pretty=format:%s --oneline --ancestry-path HEAD~1..HEAD`" --version-string="1.0.${{ github.run_number }}" $BUILD_ID
- name: Submit to TestFlight
working-directory: "./chameleonultragui"
run: |
export APP_STORE_CONNECT_PRIVATE_KEY=`cat AuthKey.p8`
app-store-connect builds submit-to-testflight $BUILD_ID || true
app-store-connect beta-groups add-build $BUILD_ID --beta-group="Open beta testing" || true
build-aur:
runs-on: ubuntu-latest
defaults:
Expand Down
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,30 @@ A GUI for the Chameleon Ultra/Chameleon Lite written in Flutter for cross platfo

#### Windows

Download the installer [here](https://nightly.link/GameTec-live/ChameleonUltraGUI/workflows/build-app/main/windows-installer.zip). Quickshare link: https://chameleonultragui.dev/windows
Download the installer [here](https://nightly.link/GameTec-live/ChameleonUltraGUI/workflows/build-app/main/windows-installer.zip). Short link: https://chameleonultragui.dev/windows

Or, [portable version](https://nightly.link/GameTec-live/ChameleonUltraGUI/workflows/build-app/main/windows.zip). Quickshare link: https://chameleonultragui.dev/windows-portable
Or, [portable version](https://nightly.link/GameTec-live/ChameleonUltraGUI/workflows/build-app/main/windows.zip). Short link: https://chameleonultragui.dev/windows-portable


#### Linux

Download the Linux build

- [Debian-based (.deb)](https://nightly.link/GameTec-live/ChameleonUltraGUI/workflows/build-app/main/linux-debian.zip). Quickshare link: https://chameleonultragui.dev/linux-debian
- [Arch-based](https://aur.archlinux.org/packages/chameleonultragui) / [Arch-based-GIT](https://aur.archlinux.org/packages/chameleonultragui-git). Quickshare link: https://chameleonultragui.dev/linux-arch
- [Other](https://nightly.link/GameTec-live/ChameleonUltraGUI/workflows/build-app/main/linux.zip). Quickshare link: https://chameleonultragui.dev/linux
- [Debian-based (.deb)](https://nightly.link/GameTec-live/ChameleonUltraGUI/workflows/build-app/main/linux-debian.zip). Short link: https://chameleonultragui.dev/linux-debian
- [Arch-based](https://aur.archlinux.org/packages/chameleonultragui) / [or -git](https://aur.archlinux.org/packages/chameleonultragui-git). Short link: https://chameleonultragui.dev/linux-arch
- [Other](https://nightly.link/GameTec-live/ChameleonUltraGUI/workflows/build-app/main/linux.zip). Short link: https://chameleonultragui.dev/linux

#### macOS / iOS / iPadOS

Download it from Apple App Store: [Chameleon Ultra GUI](https://apps.apple.com/app/chameleon-ultra-gui/id6462919364). Quickshare link: https://chameleonultragui.dev/ios
Download it from Apple App Store: [Chameleon Ultra GUI](https://apps.apple.com/app/chameleon-ultra-gui/id6462919364). Short link: https://chameleonultragui.dev/ios

Or, you can join TestFlight to get builds earlier: [Chameleon Ultra GUI - TestFlight](https://testflight.apple.com/join/UgwgfMqo)

#### Android

Download it from Google Play Store: [Chameleon Ultra GUI](https://play.google.com/store/apps/details?id=io.chameleon.ultra). Quickshare link: https://chameleonultragui.dev/android
Download it from Google Play Store: [Chameleon Ultra GUI](https://play.google.com/store/apps/details?id=io.chameleon.ultra). Short link: https://chameleonultragui.dev/android

Or, plain [APK](https://nightly.link/GameTec-live/ChameleonUltraGUI/workflows/build-app/main/apk.zip). Quickshare link: https://chameleonultragui.dev/android-apk
Or, plain [APK](https://nightly.link/GameTec-live/ChameleonUltraGUI/workflows/build-app/main/apk.zip). Short link: https://chameleonultragui.dev/android-apk

#### Pending stores:
- F-Store: not yet
Expand Down

0 comments on commit 0fde875

Please sign in to comment.