Skip to content

pre-release

pre-release #258

Workflow file for this run

name: pre-release
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+*'
jobs:
build-android-qa:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.11.1'
- name: Get release version
id: version_check
run: echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- name: Build Ionic
env:
NUMBERS_STORAGE_BASE_URL: ${{ secrets.NUMBERS_STORAGE_BASE_URL }}
NUMBERS_STORAGE_TRUSTED_CLIENT_KEY: ${{ secrets.NUMBERS_STORAGE_TRUSTED_CLIENT_KEY }}
NUMBERS_BUBBLE_DB_URL: ${{ secrets.NUMBERS_BUBBLE_DB_URL }}
NUMBERS_BUBBLE_IFRAME_URL: ${{ secrets.NUMBERS_BUBBLE_IFRAME_URL_QA_RELEASE }}
BUBBLE_API_URL: ${{ secrets.BUBBLE_API_URL }}
APPS_FLYER_DEV_KEY: ${{ secrets.APPS_FLYER_DEV_KEY }}
NUMBERS_PQINA_NPM_KEY: ${{ secrets.NUMBERS_PQINA_NPM_KEY }}
PIPEDREAM_DELETE_CAPTURE_ACCOUNT: ${{ secrets.PIPEDREAM_DELETE_CAPTURE_ACCOUNT }}
run: |
npm run preconfig.npmrc
npm install -g @ionic/cli
npm install --legacy-peer-deps
npm run build
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin' # https://github.com/actions/setup-java#supported-distributions
java-version: '17'
- name: Build debug APK
run: |
npx cap sync android
cd android/
./gradlew assembleDebug
- name: Upload debug APK and metadata to Artifacts
uses: actions/upload-artifact@v3
with:
name: app-debug.apk
path: ./android/app/build/outputs/apk/debug/app-debug.apk
- name: Upload debug metadata to Artifacts
uses: actions/upload-artifact@v3
with:
name: output-metadata.json
path: ./android/app/build/outputs/apk/debug/output-metadata.json
upload-android-qa:
runs-on: ubuntu-latest
needs: build-android-qa
steps:
- uses: actions/checkout@v4
- name: Download debug APK
uses: actions/download-artifact@v3
with:
name: app-debug.apk
- name: Download debug metadata
uses: actions/download-artifact@v3
with:
name: output-metadata.json
- name: Upload debug APK and metadata to release assets
uses: softprops/action-gh-release@v1
with:
files: |
./app-debug.apk
./output-metadata.json
build-android-prod:
runs-on: ubuntu-latest
timeout-minutes: 120
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.11.1'
- name: Get release version
id: version_check
run: echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- name: Build Ionic
env:
NUMBERS_STORAGE_BASE_URL: ${{ secrets.NUMBERS_STORAGE_BASE_URL }}
NUMBERS_STORAGE_TRUSTED_CLIENT_KEY: ${{ secrets.NUMBERS_STORAGE_TRUSTED_CLIENT_KEY }}
NUMBERS_BUBBLE_DB_URL: ${{ secrets.NUMBERS_BUBBLE_DB_URL }}
NUMBERS_BUBBLE_IFRAME_URL: ${{ secrets.NUMBERS_BUBBLE_IFRAME_URL }}
BUBBLE_API_URL: ${{ secrets.BUBBLE_API_URL }}
APPS_FLYER_DEV_KEY: ${{ secrets.APPS_FLYER_DEV_KEY }}
NUMBERS_PQINA_NPM_KEY: ${{ secrets.NUMBERS_PQINA_NPM_KEY }}
PIPEDREAM_DELETE_CAPTURE_ACCOUNT: ${{ secrets.PIPEDREAM_DELETE_CAPTURE_ACCOUNT }}
run: |
npm run preconfig.npmrc
npm install -g @ionic/cli
npm install --legacy-peer-deps
npm run build
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin' # https://github.com/actions/setup-java#supported-distributions
java-version: '17'
- name: Build Android release bundle (AAB) for Google Play Console
run: |
npx cap sync android
cd android/
./gradlew bundleRelease
- name: Sign release AAB
uses: r0adkll/sign-android-release@v1.0.4
with:
releaseDirectory: ./android/app/build/outputs/bundle/release
signingKeyBase64: ${{ secrets.ANDROID_KEYSTORE_FILE }}
alias: ${{ secrets.ANDROID_KEY_ALIAS }}
keyStorePassword: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }}
- name: Upload release AAB to Artifacts
uses: actions/upload-artifact@v3
with:
name: app-release.aab
path: ./android/app/build/outputs/bundle/release/app-release.aab
deploy-play-store:
runs-on: ubuntu-latest
needs: build-android-prod
timeout-minutes: 120
steps:
- uses: actions/checkout@v4
- name: Download release AAB
uses: actions/download-artifact@v3
with:
name: app-release.aab
- name: Create service_account.json
run: echo '${{ secrets.PLAY_CONSOLE_SERVICE_ACCOUNT_JSON }}' > service_account.json
- name: Deploy to Play Store (closed alpha track)
uses: r0adkll/upload-google-play@v1.1.1
with:
serviceAccountJson: service_account.json
packageName: io.numbersprotocol.capturelite
releaseFiles: ./app-release.aab
track: alpha
build-ios-prod:
runs-on: macos-14
timeout-minutes: 120
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.11.1'
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Get release version
id: version_check
run: echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- name: Build Ionic
env:
NUMBERS_STORAGE_BASE_URL: ${{ secrets.NUMBERS_STORAGE_BASE_URL }}
NUMBERS_STORAGE_TRUSTED_CLIENT_KEY: ${{ secrets.NUMBERS_STORAGE_TRUSTED_CLIENT_KEY }}
NUMBERS_BUBBLE_DB_URL: ${{ secrets.NUMBERS_BUBBLE_DB_URL }}
NUMBERS_BUBBLE_IFRAME_URL: ${{ secrets.NUMBERS_BUBBLE_IFRAME_URL }}
BUBBLE_API_URL: ${{ secrets.BUBBLE_API_URL }}
APPS_FLYER_DEV_KEY: ${{ secrets.APPS_FLYER_DEV_KEY }}
NUMBERS_PQINA_NPM_KEY: ${{ secrets.NUMBERS_PQINA_NPM_KEY }}
PIPEDREAM_DELETE_CAPTURE_ACCOUNT: ${{ secrets.PIPEDREAM_DELETE_CAPTURE_ACCOUNT }}
run: |
npm run preconfig.npmrc
npm install -g @ionic/cli
npm install --legacy-peer-deps
npm run build
- name: Import the Code-Signing PKCS12 Certificate
uses: apple-actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
- name: Download provisioning profiles
uses: Apple-Actions/download-provisioning-profiles@v1
with:
bundle-id: io.numbersprotocol.capturelite
profile-type: 'IOS_APP_STORE'
issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }}
api-key-id: ${{ secrets.APPSTORE_KEY_ID }}
api-private-key: ${{ secrets.APPSTORE_PRIVATE_KEY }}
- name: Get current time
uses: 1466587594/get-current-time@v2
id: current-time
with:
format: YYYYMMDDHHmmss
- name: Build iOS Xcode Archive
run: |
npx cap sync ios
xcodebuild archive -workspace ios/App/App.xcworkspace -scheme App -sdk iphoneos -configuration Release -archivePath build/App.xcarchive -showBuildTimingSummary MARKETING_VERSION=${{ steps.version_check.outputs.version }} CURRENT_PROJECT_VERSION=${{ steps.current-time.outputs.formattedTime }} -allowProvisioningUpdates archive
- name: Export IPA from Xcode Archive
run: |
xcodebuild -exportArchive -archivePath build/App.xcarchive -exportPath build -exportOptionsPlist ios/App/ExportOptions.plist -allowProvisioningUpdates
- name: Upload IPA
uses: actions/upload-artifact@v3
with:
name: App.ipa
path: build/App.ipa
- name: Save iOS build number
run: |
echo ${{ steps.current-time.outputs.formattedTime }} > build/ios-build-number.txt
- name: Upload iOS build number
uses: actions/upload-artifact@v3
with:
name: ios-build-number.txt
path: build/ios-build-number.txt
deploy-app-store:
runs-on: macos-14
needs: build-ios-prod
timeout-minutes: 120
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Download IPA
uses: actions/download-artifact@v3
with:
name: App.ipa
- name: Download iOS build number
uses: actions/download-artifact@v3
with:
name: ios-build-number.txt
- name: Upload IPA to App Store (Testflight)
uses: Apple-Actions/upload-testflight-build@master
with:
app-path: ./App.ipa
issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }}
api-key-id: ${{ secrets.APPSTORE_KEY_ID }}
api-private-key: ${{ secrets.APPSTORE_PRIVATE_KEY }}
- name: Upload iOS build number as artifact
uses: actions/upload-artifact@v2
with:
name: ios-build-number.txt
path: build/ios-build-number.txt
get-ios-build-number:
runs-on: ubuntu-latest
needs: deploy-app-store
steps:
- uses: actions/checkout@v4
- name: Download iOS build number
uses: actions/download-artifact@v2
with:
name: ios-build-number.txt
- name: Set iOS build number as Environment Variable
run: |
IOS_BUILD=`cat ios-build-number.txt`
echo "ios_build_number=$IOS_BUILD" >> $GITHUB_ENV
create-github-release:
runs-on: ubuntu-latest
needs: [deploy-play-store, get-ios-build-number]
steps:
- uses: actions/checkout@v4
- name: Get release version
id: version_check
run: echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- name: Create GitHub prerelease
id: create_release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
body: Thanks for following along! For more information check out the [CHANGELOG](https://github.com/numbersprotocol/capture-lite/blob/master/CHANGELOG.md).
prerelease: true
- name: Send Slack notification
uses: rtCamp/action-slack-notify@master
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: reminder-releases
SLACK_COLOR: '#6EE4D3'
SLACK_ICON: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png
SLACK_MESSAGE: |
Version: ${{ steps.version_check.outputs.version }}
<https://github.com/numbersprotocol/capture-lite/releases/tag/${{ steps.version_check.outputs.version }}|GitHub Release Note>
APKs
- <https://drive.google.com/drive/folders/1NH-4mruBBubxHMfXF6VXaKRCQ76Ldg_n?usp=sharing|Google Drive>
- <https://play.google.com/apps/testing/io.numbersprotocol.capturelite|Google Play Closed Alpha Testing (release)>
iOS Testflight
Build: ${{ env.ios_build_number }}
A push notification will be sent to the device with TestFlight installed when the build is ready.
Notes
- Publishing process usually requires some time to complete, and thus the link provided above might still display the old version of the app. Please check the app version before download and install the app.
- This message is automatically sent from GitHub Action.
SLACK_TITLE: Capture Lite QA Release
SLACK_USERNAME: GitHub Action