diff --git a/.github/actions/ios/action.yml b/.github/actions/ios/action.yml index 16ca599f..1951bfa3 100644 --- a/.github/actions/ios/action.yml +++ b/.github/actions/ios/action.yml @@ -26,19 +26,32 @@ runs: NO_FLIPPER=1 pod install - name: prepare shell: bash + env: + EXPORT_OPTIONS: ${{ inputs.EXPORT_OPTIONS }} run: | cd ./${CUSTOM_DIR}/ios NO_FLIPPER=1 pod install echo ${EXPORT_OPTIONS} > ExportOptions.plist - name: archive shell: bash + env: + IOS_SCHEME: ${{ inputs.IOS_SCHEME }} + APP_STORE_API_ISSUER: ${{ inputs.APP_STORE_API_ISSUER }} + APP_STORE_API_KEY: ${{ inputs.APP_STORE_API_KEY }} run: | xcodebuild -workspace ${IOS_SCHEME}.xcworkspace -scheme $IOS_SCHEME -sdk iphoneos archive -archivePath ${PWD}/build/${IOS_SCHEME}.xcarchive -allowProvisioningUpdates -quiet - name: exportArchive shell: bash + env: + IOS_SCHEME: ${{ inputs.IOS_SCHEME }} + APP_STORE_API_ISSUER: ${{ inputs.APP_STORE_API_ISSUER }} + APP_STORE_API_KEY: ${{ inputs.APP_STORE_API_KEY }} run: | xcodebuild -exportArchive -archivePath ${PWD}/build/${IOS_SCHEME}.xcarchive -exportOptionsPlist ${PWD}/ExportOptions.plist -exportPath $PWD/build -authenticationKeyIssuerID $APP_STORE_API_ISSUER -authenticationKeyID $APP_STORE_API_KEY -allowProvisioningUpdates -quiet - name: publish shell: bash + env: + APP_STORE_API_ISSUER: ${{ inputs.APP_STORE_API_ISSUER }} + APP_STORE_API_KEY: ${{ inputs.APP_STORE_API_KEY }} run: | xcrun altool --upload-app -f ./build/*.ipa -t ios --apiKey $APP_STORE_API_KEY --apiIssuer $APP_STORE_API_ISSUER diff --git a/.github/actions/release/action.yml b/.github/actions/release/action.yml index c8dca9d7..c4c610c4 100644 --- a/.github/actions/release/action.yml +++ b/.github/actions/release/action.yml @@ -1,5 +1,14 @@ -name: Test -description: 'Run tests' +name: Release +description: 'Release package' + +inputs: + GH_TOKEN: + description: GH_TOKEN + required: true + NPM_TOKEN: + description: NPM_TOKEN + required: true + runs: using: "composite" @@ -8,6 +17,6 @@ runs: shell: bash run: yarn release env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + GH_TOKEN: ${{ inputs.GH_TOKEN }} + NPM_TOKEN: ${{ inputs.NPM_TOKEN }} + NODE_AUTH_TOKEN: ${{ inputs.NPM_TOKEN }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..b249c6b8 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,40 @@ +name: Build + +on: + workflow_call: + workflow_dispatch: + +jobs: + android: + runs-on: ubuntu-latest + environment: production-android + concurrency: android + steps: + - name: Checkout + uses: actions/checkout@v4.1.1 + - name: install + uses: ./.github/actions/install + - name: android + uses: ./.github/actions/android + with: + ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} + MYAPP_UPLOAD_KEY_ALIAS: ${{ secrets.MYAPP_UPLOAD_KEY_ALIAS }} + MYAPP_UPLOAD_KEY_PASSWORD: ${{ secrets.MYAPP_UPLOAD_KEY_PASSWORD }} + MYAPP_UPLOAD_STORE_PASSWORD: ${{ secrets.MYAPP_UPLOAD_STORE_PASSWORD }} + GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} + ios: + runs-on: [self-hosted, macOS, ARM64, mobile] + environment: production-ios + concurrency: ios + steps: + - name: Checkout + uses: actions/checkout@v4.1.1 + - name: install + uses: ./.github/actions/install + - name: ios + uses: ./.github/actions/ios + with: + EXPORT_OPTIONS: ${{ secrets.EXPORT_OPTIONS }} + IOS_SCHEME: ${{ secrets.IOS_SCHEME }} + APP_STORE_API_ISSUER: ${{ secrets.APP_STORE_API_ISSUER }} + APP_STORE_API_KEY: ${{ secrets.APP_STORE_API_KEY }} diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml index 6b90893a..18b72ea0 100644 --- a/.github/workflows/development.yml +++ b/.github/workflows/development.yml @@ -4,40 +4,11 @@ on: workflow_dispatch: jobs: -# checker: -# uses: ./.github/workflows/checker.yml -# android: -# runs-on: ubuntu-latest -# needs: [checker] -# environment: production-android -# concurrency: android -# steps: -# - name: Checkout -# uses: actions/checkout@v4.1.1 -# - name: install -# uses: ./.github/actions/install -# - name: android -# uses: ./.github/actions/android -# with: -# ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} -# MYAPP_UPLOAD_KEY_ALIAS: ${{ secrets.MYAPP_UPLOAD_KEY_ALIAS }} -# MYAPP_UPLOAD_KEY_PASSWORD: ${{ secrets.MYAPP_UPLOAD_KEY_PASSWORD }} -# MYAPP_UPLOAD_STORE_PASSWORD: ${{ secrets.MYAPP_UPLOAD_STORE_PASSWORD }} -# GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} - ios: - runs-on: [self-hosted, macOS, ARM64, mobile] -# needs: [checker] - environment: production-ios - concurrency: ios - steps: - - name: Checkout - uses: actions/checkout@v4.1.1 - - name: install - uses: ./.github/actions/install - - name: ios - uses: ./.github/actions/ios - with: - EXPORT_OPTIONS: ${{ secrets.EXPORT_OPTIONS }} - IOS_SCHEME: ${{ secrets.IOS_SCHEME }} - APP_STORE_API_ISSUER: ${{ secrets.APP_STORE_API_ISSUER }} - APP_STORE_API_KEY: ${{ secrets.APP_STORE_API_KEY }} + checker: + uses: ./.github/workflows/checker.yml + release: + needs: [checker] + uses: ./.github/workflows/release.yml + build: + needs: [release] + uses: ./.github/workflows/build.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..227c4cdf --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,20 @@ +name: Checker + +on: + workflow_call: + workflow_dispatch: + +jobs: + release: + runs-on: ubuntu-latest + concurrency: release + steps: + - name: Checkout + uses: actions/checkout@v4.1.1 + - name: install + uses: ./.github/actions/install + - name: android + uses: ./.github/actions/release + with: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }}