This repository has been archived by the owner on May 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixe deploy to test fly * fix yaml * Implemet back handle for ios * fix test ci * migrate to java 17
- Loading branch information
1 parent
34f3ce0
commit 6de67e5
Showing
12 changed files
with
186 additions
and
139 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,139 +1,141 @@ | ||
name: Publish Nightly build | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- try_new_version_code_generator | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
prepare_deploy: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: "Checkout" | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions-ecosystem/action-get-latest-tag@v1 | ||
id: get-latest-tag | ||
- uses: actions-ecosystem/action-bump-semver@v1 | ||
id: bump-semver | ||
with: | ||
current_version: ${{ steps.get-latest-tag.outputs.tag }} | ||
level: patch | ||
- uses: actions-ecosystem/action-push-tag@v1 | ||
with: | ||
tag: ${{ steps.bump-semver.outputs.new_version }} | ||
- name: "Set output" | ||
id: set-output | ||
run: | | ||
echo "mix_drinks_mobile_version_name=${{ steps.bump-semver.outputs.new_version }}" >> $GITHUB_OUTPUT | ||
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 [email protected] | ||
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)) | ||
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 | ||
- name: "Setup Gradle" | ||
uses: gradle/gradle-build-action@v2 | ||
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 | ||
- name: "Setup Gradle" | ||
uses: gradle/gradle-build-action@v2 | ||
|
||
- name: "Build bundle release" | ||
run: gradle android:bundleRelease | ||
- name: "Build bundle release" | ||
run: gradle android: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: 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}} | ||
- 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: beta | ||
status: completed | ||
- 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: beta | ||
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 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'zulu' | ||
java-version: '17' | ||
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 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'zulu' | ||
java-version: '17' | ||
|
||
- name: "Setup Gradle" | ||
uses: gradle/gradle-build-action@v2 | ||
- name: "Setup Gradle" | ||
uses: gradle/gradle-build-action@v2 | ||
|
||
- name: "Build xcworkspace" | ||
run: ./gradlew podInstall | ||
- name: "Build xcworkspace" | ||
run: ./gradlew podInstall | ||
|
||
- name: "Setup app version" | ||
uses: yanamura/ios-bump-version@v1 | ||
with: | ||
version: ${{ env.MIXDRINKS_MOBILE_APP_VERSION_NAME }} | ||
build-number: ${{ env.MIXDRINKS_MOBILE_APP_VERSION_CODE }} | ||
project-path: iosApp | ||
- name: "Setup app version" | ||
uses: yanamura/ios-bump-version@v1 | ||
with: | ||
version: ${{ env.MIXDRINKS_MOBILE_APP_VERSION_NAME }} | ||
build-number: ${{ env.MIXDRINKS_MOBILE_APP_VERSION_CODE }} | ||
project-path: iosApp | ||
|
||
- name: "Build IOS App" | ||
uses: yukiarrr/[email protected] | ||
with: | ||
project-path: iosApp/iosApp.xcodeproj | ||
p12-base64: ${{ secrets.MIXDRINKS_IOS_P12_BASE64 }} | ||
mobileprovision-base64: ${{ secrets.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 }} | ||
workspace-path: iosApp/iosApp.xcworkspace | ||
export-method: "ad-hoc" | ||
- name: "Upload IPA file as artifact" | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: IOS IPA | ||
path: "output.ipa" | ||
- name: "Build IOS App" | ||
uses: yukiarrr/[email protected] | ||
with: | ||
project-path: iosApp/iosApp.xcodeproj | ||
p12-base64: ${{ secrets.MIXDRINKS_IOS_P12_BASE64 }} | ||
mobileprovision-base64: ${{ secrets.MIXDRINKS_IOS_BUILD_PROVISION_PROFILE_BASE64_TESTFLY }} | ||
code-signing-identity: "iPhone Distribution" | ||
team-id: ${{ secrets.MIXDRINKS_IOS_TEAM_ID }} | ||
certificate-password: ${{ secrets.MIXDRINKS_IOS_CERTIFICATE_PASSWORD }} | ||
export-options: iosApp/exportOptionsTestFly.plist | ||
workspace-path: iosApp/iosApp.xcworkspace | ||
export-method: "ad-hoc" | ||
- 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: 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: "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 |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>method</key> | ||
<string>ad-hoc</string> | ||
<key>provisioningProfiles</key> | ||
<dict> | ||
<key>org.mixdrinks.app9LJW42P73L</key> | ||
<string>TestFly(signIn)</string> | ||
</dict> | ||
</dict> | ||
</plist> |
This file contains 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
This file contains 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
Oops, something went wrong.