Skip to content

Commit 9505a93

Browse files
roryabrahamOSBotify
authored andcommitted
Merge pull request #47253 from Expensify/andrew-staging-release
[No QA]Tag the `staging` branch instead of `main` for pre-release (cherry picked from commit 8ddece2) (CP triggered by AndrewGable)
1 parent 6fd7f5e commit 9505a93

File tree

2 files changed

+20
-64
lines changed

2 files changed

+20
-64
lines changed

.github/workflows/deploy.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
run: echo "STAGING_VERSION=$(npm run print-version --silent)" >> "$GITHUB_ENV"
2828

2929
- name: 🚀 Create prerelease to trigger staging deploy 🚀
30-
run: gh release create ${{ env.STAGING_VERSION }} --title ${{ env.STAGING_VERSION }} --generate-notes --prerelease
30+
run: gh release create ${{ env.STAGING_VERSION }} --title ${{ env.STAGING_VERSION }} --generate-notes --prerelease --target staging
3131
env:
3232
GITHUB_TOKEN: ${{ steps.setupGitForOSBotify.outputs.OS_BOTIFY_API_TOKEN }}
3333

.github/workflows/platformDeploy.yml

+19-63
Original file line numberDiff line numberDiff line change
@@ -85,31 +85,19 @@ jobs:
8585
MYAPP_UPLOAD_KEY_PASSWORD: ${{ secrets.MYAPP_UPLOAD_KEY_PASSWORD }}
8686
VERSION: ${{ env.VERSION_CODE }}
8787

88-
- name: Archive Android sourcemaps
89-
uses: actions/upload-artifact@v4
90-
with:
91-
name: android-sourcemap-${{ github.event.release.tag_name }}
92-
path: android/app/build/generated/sourcemaps/react/productionRelease/index.android.bundle.map
93-
94-
- name: Upload Android build to GitHub artifacts
95-
if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
96-
uses: actions/upload-artifact@v4
97-
with:
98-
name: app-production-release.aab
99-
path: android/app/build/outputs/bundle/productionRelease/app-production-release.aab
100-
10188
- name: Upload Android build to Browser Stack
10289
if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
10390
run: curl -u "$BROWSERSTACK" -X POST "https://api-cloud.browserstack.com/app-live/upload" -F "file=@./android/app/build/outputs/bundle/productionRelease/app-production-release.aab"
10491
env:
10592
BROWSERSTACK: ${{ secrets.BROWSERSTACK }}
10693

94+
- name: Upload Android sourcemaps to GitHub Release
95+
if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
96+
run: gh release upload ${{ github.event.release.tag_name }} android/app/build/generated/sourcemaps/react/productionRelease/index.android.bundle.map#android-sourcemap-${{ github.event.release.tag_name }}
97+
10798
- name: Upload Android build to GitHub Release
108-
if: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
109-
run: |
110-
RUN_ID="$(gh run list --workflow platformDeploy.yml --event push --branch ${{ github.event.release.tag_name }} --json databaseId --jq '.[0].databaseId')"
111-
gh run download "$RUN_ID" --name app-production-release.aab
112-
gh release upload ${{ github.event.release.tag_name }} app-production-release.aab
99+
if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
100+
run: gh release upload ${{ github.event.release.tag_name }} android/app/build/outputs/bundle/productionRelease/app-production-release.aab
113101
env:
114102
GITHUB_TOKEN: ${{ github.token }}
115103

@@ -164,24 +152,14 @@ jobs:
164152
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
165153
GCP_GEOLOCATION_API_KEY: $${{ secrets.GCP_GEOLOCATION_API_KEY_PRODUCTION }}
166154

167-
- name: Upload desktop build to GitHub Workflow
168-
uses: actions/upload-artifact@v4
169-
with:
170-
name: NewExpensify.dmg
171-
path: desktop-build/NewExpensify.dmg
155+
- name: Upload desktop sourcemaps to GitHub Release
156+
run: gh release upload ${{ github.event.release.tag_name }} desktop/dist/www/merged-source-map.js.map#desktop-sourcemap-${{ github.event.release.tag_name }} --clobber
172157

173158
- name: Upload desktop build to GitHub Release
174-
if: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
175-
run: gh release upload ${{ github.event.release.tag_name }} desktop-build/NewExpensify.dmg
159+
run: gh release upload ${{ github.event.release.tag_name }} desktop-build/NewExpensify.dmg --clobber
176160
env:
177161
GITHUB_TOKEN: ${{ github.token }}
178162

179-
- name: Archive desktop sourcemaps
180-
uses: actions/upload-artifact@v4
181-
with:
182-
name: desktop-sourcemap-${{ github.event.release.tag_name }}
183-
path: desktop/dist/www/merged-source-map.js.map
184-
185163
iOS:
186164
name: Build and deploy iOS
187165
needs: validateActor
@@ -257,31 +235,19 @@ jobs:
257235
APPLE_DEMO_PASSWORD: ${{ secrets.APPLE_DEMO_PASSWORD }}
258236
VERSION: ${{ env.IOS_VERSION }}
259237

260-
- name: Archive iOS sourcemaps
261-
uses: actions/upload-artifact@v4
262-
with:
263-
name: ios-sourcemap-${{ github.event.release.tag_name }}
264-
path: main.jsbundle.map
265-
266-
- name: Upload iOS build to GitHub artifacts
267-
if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
268-
uses: actions/upload-artifact@v4
269-
with:
270-
name: New Expensify.ipa
271-
path: /Users/runner/work/App/App/New Expensify.ipa
272-
273238
- name: Upload iOS build to Browser Stack
274239
if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
275240
run: curl -u "$BROWSERSTACK" -X POST "https://api-cloud.browserstack.com/app-live/upload" -F "file=@/Users/runner/work/App/App/New Expensify.ipa"
276241
env:
277242
BROWSERSTACK: ${{ secrets.BROWSERSTACK }}
278243

244+
- name: Upload iOS sourcemaps to GitHub Release
245+
if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
246+
run: gh release upload ${{ github.event.release.tag_name }} main.jsbundle.map#ios-sourcemap-${{ github.event.release.tag_name }}
247+
279248
- name: Upload iOS build to GitHub Release
280-
if: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
281-
run: |
282-
RUN_ID="$(gh run list --workflow platformDeploy.yml --event push --branch ${{ github.event.release.tag_name }} --json databaseId --jq '.[0].databaseId')"
283-
gh run download "$RUN_ID" --name 'New Expensify.ipa'
284-
gh release upload ${{ github.event.release.tag_name }} 'New Expensify.ipa'
249+
if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
250+
run: gh release upload ${{ github.event.release.tag_name }} /Users/runner/work/App/App/New Expensify.ipa
285251
env:
286252
GITHUB_TOKEN: ${{ github.token }}
287253

@@ -350,12 +316,6 @@ jobs:
350316
env:
351317
S3_URL: s3://${{ env.SHOULD_DEPLOY_PRODUCTION != 'true' && 'staging-' || '' }}expensify-cash
352318

353-
- name: Archive web sourcemaps
354-
uses: actions/upload-artifact@v4
355-
with:
356-
name: web-sourcemap-${{ github.event.release.tag_name }}
357-
path: dist/merged-source-map.js.map
358-
359319
- name: Purge Cloudflare cache
360320
run: /home/runner/.local/bin/cli4 --verbose --delete hosts=["${{ env.SHOULD_DEPLOY_PRODUCTION != 'true' && 'staging.' || '' }}new.expensify.com"] /zones/:9ee042e6cfc7fd45e74aa7d2f78d617b/purge_cache
361321
env:
@@ -379,18 +339,14 @@ jobs:
379339
exit 1
380340
fi
381341
382-
- name: Upload web build to GitHub artifacts
383-
uses: actions/upload-artifact@v4
384-
with:
385-
name: web-build
386-
path: dist
342+
- name: Upload web sourcemaps to GitHub Release
343+
run: gh release upload ${{ github.event.release.tag_name }} dist/merged-source-map.js.map#web-sourcemap-${{ github.event.release.tag_name }} --clobber
387344

388345
- name: Upload web build to GitHub Release
389-
if: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
390346
run: |
391347
tar -czvf webBuild.tar.gz dist
392348
zip -r webBuild.zip dist
393-
gh release upload ${{ github.event.release.tag_name }} webBuild.tar.gz webBuild.zip
349+
gh release upload ${{ github.event.release.tag_name }} webBuild.tar.gz webBuild.zip --clobber
394350
env:
395351
GITHUB_TOKEN: ${{ github.token }}
396352

@@ -412,7 +368,7 @@ jobs:
412368
hybridApp:
413369
runs-on: ubuntu-latest
414370
needs: validateActor
415-
if: ${{ fromJSON(needs.validateActor.outputs.IS_DEPLOYER) && github.event_name == 'push' }}
371+
if: ${{ fromJSON(needs.validateActor.outputs.IS_DEPLOYER) && github.event.action != 'released' }}
416372
steps:
417373
- name: Checkout
418374
uses: actions/checkout@v4

0 commit comments

Comments
 (0)