[WIP] use xcrun altool #47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: PullRequest | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: write-all | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: macos-latest | |
| timeout-minutes: 40 | |
| env: | |
| DEVELOPER_DIR: "/Applications/Xcode_16.2.app/Contents/Developer" | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: archive | |
| run: | | |
| xcodebuild archive CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO -project ./ci-sample.xcodeproj -scheme ci-sample -configuration Release -archivePath ./ci-sample_release | |
| - name: build | |
| env: | |
| AUTHKEY_P8_BASE64: ${{ secrets.AUTHKEY_P8_BASE64 }} | |
| ISSUER_ID: ${{ secrets.ISSUER_ID }} | |
| KEY_ID: ${{ secrets.KEY_ID }} | |
| run: | | |
| echo "${AUTHKEY_P8_BASE64}" | base64 -d > "${PWD}/Authkey.p8" | |
| xcodebuild -exportArchive -archivePath ci-sample_release.xcarchive -exportPath ./build_result -exportOptionsPlist ./ExportOptionsAppStoreConnect.plist -allowProvisioningUpdates -authenticationKeyIssuerID "${ISSUER_ID}" -authenticationKeyID "${KEY_ID}" -authenticationKeyPath "${PWD}/Authkey.p8" | |
| - name: upload app store connect | |
| env: | |
| ISSUER_ID: ${{ secrets.ISSUER_ID }} | |
| KEY_ID: ${{ secrets.KEY_ID }} | |
| AUTHKEY_P8_BASE64: ${{ secrets.AUTHKEY_P8_BASE64 }} | |
| run: | | |
| mkdir ./private_keys | |
| echo -n "${AUTHKEY_P8_BASE64}" | base64 -d --output ./private_keys/AuthKey_${KEY_ID}.p8 | |
| xcrun altool --validate-app -f ./build_result/ci-sample.ipa -t ios --apiKey "${KEY_ID}" --apiIssuer "${ISSUER_ID}" | |
| xcrun altool --upload-app -f ./build_result/ci-sample.ipa -t ios --apiKey "${KEY_ID}" --apiIssuer "${ISSUER_ID}" | |
| - name: archive | |
| if: ${{ always() }} | |
| uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1 | |
| with: | |
| name: ipa file | |
| path: ./build_result/*.ipa | |
| test: | |
| runs-on: macos-latest | |
| timeout-minutes: 40 | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Cache bundle directory | |
| uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2 | |
| with: | |
| path: vendor/bundle | |
| key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gem- | |
| - name: bundler | |
| run: | | |
| bundle config path vendor/bundle | |
| bundle install --jobs 4 --retry 3 | |
| - name: test | |
| run: | | |
| bundle exec fastlane test |