🔨 .gitignore: ignore all of .idea/ #58
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
name: CI | |
on: push | |
jobs: | |
Build: | |
runs-on: ubuntu-22.04 | |
env: | |
ANDROID_KEYSTORE_PATH: keys.keystore | |
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_RELEASE_KEYSTORE_PASSWORD }} | |
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_RELEASE_KEY_ALIAS }} | |
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_RELEASE_KEY_PASSWORD }} | |
S3_BASE_URL: s3://dl.eidu.com/ | |
S3_HTTP_BASE_URL: https://dl.eidu.com/ | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_S3_UPLOAD_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_UPLOAD_SECRET_ACCESS_KEY }} | |
AWS_EC2_METADATA_DISABLED: true | |
steps: | |
# This step serves as a workaround for not being able to use ${{ env.* }} in global env vars. | |
- name: Set dynamic environment variables for test app | |
run: | | |
echo "S3_CI_OBJECT_PATH=ci/integration-test-app-$GITHUB_RUN_NUMBER.apk" >> $GITHUB_ENV | |
echo "S3_LATEST_OBJECT_PATH=dev/integration-test-app.apk" >> $GITHUB_ENV | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: '11' | |
- uses: actions/checkout@v2 | |
- name: Get tags for versioning the app | |
run: git fetch --tags -f | |
- name: Lint and test | |
run: ./gradlew lintRelease test --stacktrace | |
- name: Publish reports | |
uses: actions/upload-artifact@v1 | |
with: | |
name: test-reports | |
path: app/build/reports | |
- name: Build APK | |
run: | | |
base64 -d <<< "${{ secrets.ANDROID_RELEASE_KEYSTORE_BASE64 }}" > integration-test-app/$ANDROID_KEYSTORE_PATH | |
./gradlew assembleRelease --stacktrace | |
- name: Upload App APK to S3 (by run number) | |
run: | | |
aws s3 cp integration-test-app/build/outputs/apk/release/integration-test-app-release.apk "${{ env.S3_BASE_URL }}${{ env.S3_CI_OBJECT_PATH }}" | |
- name: Upload App APK to S3 (latest) | |
run: | | |
aws s3 cp integration-test-app/build/outputs/apk/release/integration-test-app-release.apk "${{ env.S3_BASE_URL }}${{ env.S3_LATEST_OBJECT_PATH }}" | |
if: github.ref == 'refs/heads/main' |