diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..c8c794d --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,110 @@ +name: Build iOS IPA + +on: + push: + branches: [main] + workflow_dispatch: + inputs: + configuration: + description: 'Build configuration' + required: true + default: 'debug' + type: choice + options: ['debug', 'release'] + +jobs: + build: + name: Build IPA + runs-on: macos-14 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set Xcode version + run: sudo xcode-select -s /Applications/Xcode_15.4.app + + - name: Show Xcode version + run: xcodebuild -version + + - name: Show build settings + run: | + xcodebuild -project AreYouSleeping.xcodeproj \ + -scheme AreYouSleeping \ + -showBuildSettings \ + -destination 'generic/platform=iOS' + + - name: Set build number + run: | + BUILD_NUM=${{ github.run_number }} + /usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${BUILD_NUM}" AreYouSleeping/Info.plist + + - name: Build archive + run: | + xcodebuild archive \ + -project AreYouSleeping.xcodeproj \ + -scheme AreYouSleeping \ + -configuration Release \ + -destination 'generic/platform=iOS' \ + -archivePath build/AreYouSleeping.xcarchive \ + CODE_SIGNING_ALLOWED=NO \ + CODE_SIGNING_REQUIRED=NO \ + CODE_SIGN_IDENTITY="" | xcpretty + + - name: Package IPA + run: | + mkdir -p build/Payload + cp -R build/AreYouSleeping.xcarchive/Products/Applications/AreYouSleeping.app build/Payload/ + cd build + zip -r AreYouSleeping.ipa Payload + cd .. + + - name: Upload IPA artifact + uses: actions/upload-artifact@v4 + with: + name: AreYouSleeping-${{ github.run_number }}.ipa + path: build/AreYouSleeping.ipa + retention-days: 30 + + - name: Generate install manifest + run: | + cat > build/manifest.plist << 'PLIST' + + + + + items + + + assets + + + kind + software-package + url + __IPA_URL__ + + + metadata + + bundle-identifier + com.ausleep.ios + bundle-version + ${{ github.run_number }} + kind + software + title + 睡了吗 + + + + + + PLIST + + - name: Upload manifest + uses: actions/upload-artifact@v4 + with: + name: OTA-manifest + path: build/manifest.plist + retention-days: 30