Skip to content

Commit

Permalink
ci(artifact_proxy): add dev deployment w/engine-patch (#275)
Browse files Browse the repository at this point in the history
  • Loading branch information
felangel authored Apr 10, 2023
1 parent 7e121b0 commit 34cfb4b
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy Artifact Proxy
name: Deploy Artifact Proxy Dev

on:
workflow_dispatch:
Expand All @@ -10,7 +10,7 @@ on:
- "packages/artifact_proxy/**"

env:
PROJECT_ID: code-push-prod
PROJECT_ID: code-push-dev
SERVICE: artifact-proxy
REGION: us-central1

Expand All @@ -36,7 +36,7 @@ jobs:
uses: google-github-actions/setup-gcloud@v0.2.0
with:
project_id: ${{ env.PROJECT_ID }}
service_account_key: ${{ secrets.CLOUD_RUN_SA_PROD }}
service_account_key: ${{ secrets.CLOUD_RUN_SA_DEV }}
export_default_credentials: true

- name: Authorize Docker Push
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/deploy_artifact_proxy_prod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Deploy Artifact Proxy Prod

on:
workflow_dispatch:

env:
PROJECT_ID: code-push-prod
SERVICE: artifact-proxy
REGION: us-central1

jobs:
deploy:
runs-on: ubuntu-latest

defaults:
run:
working-directory: packages/artifact_proxy

name: ☁️ Artifact Proxy

steps:
- name: 📚 Git Checkout
uses: actions/checkout@v3
with:
submodules: recursive

- uses: dart-lang/setup-dart@v1

- name: Setup Cloud SDK
uses: google-github-actions/setup-gcloud@v0.2.0
with:
project_id: ${{ env.PROJECT_ID }}
service_account_key: ${{ secrets.CLOUD_RUN_SA_PROD }}
export_default_credentials: true

- name: Authorize Docker Push
run: gcloud auth configure-docker

- name: Build and Push Container
run: |-
docker build -t gcr.io/${{ env.PROJECT_ID }}/${{ env.SERVICE }}:${{ github.sha }} .
docker push gcr.io/${{ env.PROJECT_ID }}/${{ env.SERVICE }}:${{ github.sha }}
- name: Deploy to Cloud Run
id: deploy
uses: google-github-actions/deploy-cloudrun@v0.4.0
with:
service: ${{ env.SERVICE }}
image: gcr.io/${{ env.PROJECT_ID }}/${{ env.SERVICE }}:${{ github.sha }}
region: ${{ env.REGION }}

- name: Show Output
run: echo ${{ steps.deploy.outputs.url }}

- name: Ping
run: curl "${{ steps.deploy.outputs.url }}"
7 changes: 6 additions & 1 deletion packages/artifact_proxy/lib/config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const config = ProxyConfig(
class _EngineMapping3_7 extends EngineMapping {
const _EngineMapping3_7({
required super.flutterEngineRevision,
super.shorebirdStorageBucket = 'download.shorebird.dev',
}) : super(
shorebirdStorageBucket: 'download.shorebird.dev',
shorebirdArtifactOverrides: const {
// artifacts.zip
r'flutter_infra_release/flutter/$engine/android-arm-64-release/artifacts.zip',
Expand Down Expand Up @@ -42,6 +42,11 @@ class _EngineMapping3_7 extends EngineMapping {

/// Flutter 3.7.10
const flutter_3_7_10 = {
// Attempt to fix https://github.com/shorebirdtech/shorebird/issues/235
'f68335f3f6afdb1595420b1c3b5a16c8da75a1cf': _EngineMapping3_7(
shorebirdStorageBucket: 'download-dev.shorebird.dev',
flutterEngineRevision: 'ec975089acb540fc60752606a3d3ba809dd1528b',
),
'978a56f2d97f9ce24a2b6bc22c9bbceaaba0343c': _EngineMapping3_7(
flutterEngineRevision: 'ec975089acb540fc60752606a3d3ba809dd1528b',
),
Expand Down

0 comments on commit 34cfb4b

Please sign in to comment.