.github/workflows/build.yml #16
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
on: [workflow_dispatch] | |
jobs: | |
build: | |
runs-on: macos-latest | |
name: Build the project | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# Run your project's build step | |
# - name: Build | |
# run: npm install && npm run build | |
- name: Set up node | |
# ADD YOUR CUSTOM DEPENDENCY UPGRADE COMMANDS BELOW | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "20" | |
- name: Load secret | |
uses: 1password/load-secrets-action@v1 | |
with: | |
# Export loaded secrets as environment variables | |
export-env: true | |
env: | |
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} | |
AWS_KEY_ID: "op://DevOps/cloudflare-r2-token/access-key-id" | |
AWS_SECRET_ACCESS_KEY: "op://DevOps/cloudflare-r2-token/secret-access-key" | |
RELEASE_KEYSTORE: "op://DevOps/btt-android-keystore-key/base64-encoded-jks" | |
RELEASE_KEYSTORE_PASSWORD: "op://DevOps/btt-android-keystore-key/keystore-password" | |
ENDPOINT: "op://DevOps/cloudflare-r2-token/endpoint" | |
- name: | |
Install JS dependencies and build | |
# ADD YOUR CUSTOM DEPENDENCY UPGRADE COMMANDS BELOW | |
run: | | |
npm ci && npm run build-ios && npm run build-android | |
env: | |
VITE_POLICY_KEY: ${{ secrets.VITE_POLICY_KEY }} | |
VITE_BC_ACCOUNT_ID: ${{ secrets.VITE_BC_ACCOUNT_ID }} | |
- name: Get current date | |
id: date | |
run: echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT" | |
- name: Build app bundle | |
run: cd android && ./gradlew bundle | |
- name: Extract Android signing key from env | |
run: | | |
echo "${{ secrets.RELEASE_KEYSTORE }}" > android/release.jks.base64 | |
base64 -d android/release.jks.base64 > android/release.decrypted.jks | |
- name: Sign dev build | |
run: jarsigner -keystore android/release.decrypted.jks -storepass "${{ secrets.RELEASE_KEYSTORE_PASSWORD }}" -signedjar ./android/app/build/outputs/bundle/release/app-release-signed.aab ./android/app/build/outputs/bundle/release/app-release.aab release | |
- name: Upload Android to R2 | |
uses: shallwefootball/s3-upload-action@master | |
with: | |
aws_key_id: ${{ env.AWS_KEY_ID }} | |
aws_secret_access_key: ${{ env.AWS_SECRET_ACCESS_KEY}} | |
aws_bucket: dot-mobile | |
source_dir: "./android/app/build/outputs/bundle/release" | |
destination_dir: "android/${{steps.date.outputs.date}}" | |
endpoint: ${{ env.ENDPOINT }} | |
# - name: zip the built folder | |
# run: mkdir ./dottmp && zip -r ./dottmp/${{steps.date.outputs.date}}-dotapp ./ios | |
# - name: Upload IOS to R2 | |
# uses: shallwefootball/s3-upload-action@master | |
# with: | |
# aws_key_id: ${{ env.AWS_KEY_ID }} | |
# aws_secret_access_key: ${{ env.AWS_SECRET_ACCESS_KEY}} | |
# aws_bucket: dot-mobile | |
# source_dir: "./dottmp" | |
# destination_dir: "ios" | |
# endpoint: ${{ env.ENDPOINT }} |