This repository was archived by the owner on Feb 2, 2026. It is now read-only.
Publish production build #121
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: Publish production build | |
| on: | |
| schedule: | |
| - cron: '0 16 * * 2' | |
| workflow_dispatch: | |
| jobs: | |
| prepare_deploy: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set env | |
| id: last_tag | |
| run: echo "LAST_TAG=$(git tag --sort=committerdate | tail -1)" >> $GITHUB_OUTPUT | |
| - uses: actions-ecosystem/action-bump-semver@v1 | |
| id: bump-semver | |
| with: | |
| current_version: ${{ steps.last_tag.outputs.LAST_TAG }} | |
| level: patch | |
| - run: | | |
| git config user.name github-actions | |
| git config user.email github-actions@github.com | |
| git tag ${{ steps.bump-semver.outputs.new_version }} | |
| git push --tags | |
| - name: "Set output" | |
| id: set-output | |
| run: | | |
| echo "mix_drinks_mobile_version_name=${{ steps.bump-semver.outputs.new_version }}" >> $GITHUB_OUTPUT | |
| IFS='.' read -r major minor patch <<< "${{ steps.bump-semver.outputs.new_version }}" | |
| mix_drinks_mobile_version_code=$((major * 10000 + minor * 100 + patch)) | |
| echo "mix_drinks_mobile_version_code=${mix_drinks_mobile_version_code}" >> $GITHUB_OUTPUT | |
| - name: "Print output" | |
| run: | | |
| echo -e "Version name is: \n ${{ steps.set-output.outputs.mix_drinks_mobile_version_name }}" | |
| echo -e "Version code is: \n ${{ steps.set-output.outputs.mix_drinks_mobile_version_code }}" | |
| outputs: | |
| output_write_mix_drinks_mobile_version_name: ${{ steps.set-output.outputs.mix_drinks_mobile_version_name }} | |
| output_write_mix_drinks_mobile_version_code: ${{ steps.set-output.outputs.mix_drinks_mobile_version_code }} | |
| deploy_android: | |
| needs: [ prepare_deploy ] | |
| env: | |
| MIXDRINKS_MOBILE_APP_VERSION_NAME: ${{ needs.prepare_deploy.outputs.output_write_mix_drinks_mobile_version_name }} | |
| MIXDRINKS_MOBILE_APP_VERSION_CODE: ${{ needs.prepare_deploy.outputs.output_write_mix_drinks_mobile_version_code }} | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-java@v3 | |
| with: | |
| java-version: '17' | |
| distribution: 'adopt' | |
| architecture: x64 | |
| - name: Build with Gradle | |
| uses: gradle/gradle-build-action@v2.5.1 | |
| with: | |
| arguments: androidApp:bundleRelease | |
| - uses: r0adkll/sign-android-release@v1 | |
| name: "Sign app aab file" | |
| id: sign_app | |
| with: | |
| releaseDirectory: androidApp/build/outputs/bundle/release | |
| signingKeyBase64: ${{ secrets.MIXDRINKS_ANDROID_SIGNING_KEY }} | |
| alias: ${{ secrets.MIXDRINKS_ANDROID_ALIAS }} | |
| keyStorePassword: ${{ secrets.MIXDRINKS_ANDROID_KEY_STORE_PASSWORD }} | |
| keyPassword: ${{ secrets.MIXDRINKS_ANDROID_KEY_PASSWORD }} | |
| env: | |
| BUILD_TOOLS_VERSION: "30.0.2" | |
| - uses: actions/upload-artifact@v3 | |
| with: | |
| name: "Upload AAB file as artifact" | |
| path: ${{steps.sign_app.outputs.signedReleaseFile}} | |
| - name: "Upload to Google Play" | |
| uses: r0adkll/upload-google-play@v1 | |
| with: | |
| serviceAccountJsonPlainText: ${{ secrets.MIXDRINKS_ANDROID_DEPLOY_SERVICE_ACCOUNT_JSON }} | |
| packageName: org.mixdrinks.app | |
| releaseFiles: ${{steps.sign_app.outputs.signedReleaseFile}} | |
| track: production | |
| status: completed | |
| deploy_ios: | |
| needs: [ prepare_deploy ] | |
| env: | |
| MIXDRINKS_MOBILE_APP_VERSION_NAME: ${{ needs.prepare_deploy.outputs.output_write_mix_drinks_mobile_version_name }} | |
| MIXDRINKS_MOBILE_APP_VERSION_CODE: ${{ needs.prepare_deploy.outputs.output_write_mix_drinks_mobile_version_code }} | |
| runs-on: macos-12 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Apply versions | |
| run: | | |
| /usr/libexec/Plistbuddy -c "Set CFBundleVersion $MIXDRINKS_MOBILE_APP_VERSION_CODE" iosApp/iosApp/Info.plist | |
| /usr/libexec/Plistbuddy -c "Set CFBundleShortVersionString $MIXDRINKS_MOBILE_APP_VERSION_NAME" iosApp/iosApp/Info.plist | |
| - uses: actions/setup-java@v3 | |
| with: | |
| java-version: '17' | |
| distribution: 'adopt' | |
| architecture: x64 | |
| - name: Build pod install | |
| uses: gradle/gradle-build-action@v2.5.1 | |
| with: | |
| arguments: podInstall | |
| - name: "Build IOS App" | |
| uses: yukiarrr/ios-build-action@v1.11.0 | |
| with: | |
| project-path: iosApp/iosApp.xcodeproj | |
| p12-base64: ${{ secrets.MIXDRINKS_IOS_P12_BASE64 }} | |
| mobileprovision-base64: ${{ secrets.PROD_MIXDRINKS_IOS_BUILD_PROVISION_PROFILE_BASE64 }} | |
| code-signing-identity: "iPhone Distribution" | |
| team-id: ${{ secrets.MIXDRINKS_IOS_TEAM_ID }} | |
| certificate-password: ${{ secrets.MIXDRINKS_IOS_CERTIFICATE_PASSWORD }} | |
| export-options: iosApp/exportOptionsRelease.plist | |
| workspace-path: iosApp/iosApp.xcworkspace | |
| export-method: "app-store" | |
| - name: "Upload IPA file as artifact" | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: IOS IPA | |
| path: "output.ipa" | |
| - name: Install private API key P8 | |
| env: | |
| PRIVATE_API_KEY_BASE64: ${{ secrets.MIXDRINKS_IOS_APPSTORE_API_PRIVATE_KEY }} | |
| API_KEY: ${{ secrets.MIXDRINKS_IOS_APPSTORE_API_KEY_ID }} | |
| run: | | |
| mkdir -p ~/private_keys | |
| echo -n "$PRIVATE_API_KEY_BASE64" | base64 --decode --output ~/private_keys/AuthKey_$API_KEY.p8 | |
| - name: "Upload IPA file to test flight" | |
| env: | |
| API_KEY: ${{ secrets.MIXDRINKS_IOS_APPSTORE_API_KEY_ID }} | |
| API_ISSUER: ${{ secrets.MIXDRINKS_IOS_APPSTORE_ISSUER_ID }} | |
| run: xcrun altool --output-format xml --upload-app -f output.ipa -t ios --apiKey $API_KEY --apiIssuer $API_ISSUER | |
| - name: Get appstore token | |
| id: asc | |
| uses: yuki0n0/action-appstoreconnect-token@v1.0 | |
| with: | |
| issuer id: ${{ secrets.MIXDRINKS_IOS_APPSTORE_ISSUER_ID }} | |
| key id: ${{ secrets.MIXDRINKS_IOS_APPSTORE_ADMIN_API_KEY_ID }} | |
| key: ${{ secrets.MIXDRINKS_IOS_APPSTORE_ADMIN_API_PRIVATE_KEY_RAW }} | |
| - name: Create appstore version | |
| env: | |
| APP_VERSION: ${{ env.MIXDRINKS_MOBILE_APP_VERSION_NAME }} | |
| run: | | |
| JSON=`curl -sS -H "Authorization:Bearer ${{ steps.asc.outputs.token }}" https://api.appstoreconnect.apple.com/v1/appStoreVersions -d '{"data": {"type": "appStoreVersions","attributes": {"platform": "IOS","versionString": "${APP_VERSION}","copyright": "© 2020 MixDrinks","releaseType": "MANUAL","usesIdfa": false},"relationships": {"app": {"data": {"type": "apps","id": "6447103081"}}}}}' -H 'Content-Type: application/json'` | |
| echo $JSON |