@@ -28,12 +28,35 @@ jobs:
28
28
env :
29
29
GITHUB_TOKEN : ${{ secrets.OS_BOTIFY_TOKEN }}
30
30
31
+ createTag :
32
+ needs : validateActor
33
+ if : ${{ github.ref == 'refs/heads/staging' }}
34
+ runs-on : ubuntu-latest
35
+ steps :
36
+ - name : Checkout
37
+ uses : actions/checkout@v4
38
+ with :
39
+ token : ${{ secrets.OS_BOTIFY_TOKEN }}
40
+
41
+ - name : Setup git for OSBotify
42
+ uses : ./.github/actions/composite/setupGitForOSBotifyApp
43
+ id : setupGitForOSBotify
44
+ with :
45
+ GPG_PASSPHRASE : ${{ secrets.LARGE_SECRET_PASSPHRASE }}
46
+ OS_BOTIFY_APP_ID : ${{ secrets.OS_BOTIFY_APP_ID }}
47
+ OS_BOTIFY_PRIVATE_KEY : ${{ secrets.OS_BOTIFY_PRIVATE_KEY }}
48
+
49
+ - name : Create and push tag
50
+ run : |
51
+ git tag "$(jq -r .version < package.json)"
52
+ git push origin --tags
53
+
31
54
# Note: we're updating the checklist before running the deploys and assuming that it will succeed on at least one platform
32
55
deployChecklist :
33
56
name : Create or update deploy checklist
34
57
uses : ./.github/workflows/createDeployChecklist.yml
35
58
if : ${{ github.ref == 'refs/heads/staging' }}
36
- needs : validateActor
59
+ needs : createTag
37
60
secrets : inherit
38
61
39
62
android :
45
68
steps :
46
69
- name : Checkout
47
70
uses : actions/checkout@v4
48
-
71
+
49
72
- name : Configure MapBox SDK
50
73
run : ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }}
51
74
@@ -446,32 +469,19 @@ jobs:
446
469
if : ${{ github.ref == 'refs/heads/staging' && fromJSON(needs.checkDeploymentSuccess.outputs.IS_AT_LEAST_ONE_PLATFORM_DEPLOYED) }}
447
470
needs : [checkDeploymentSuccess]
448
471
steps :
449
- # The command "gh release create" also creates and pushes a tag for the version if one does not already exist,
450
- # So we need to checkout the staging branch and create that tag from the staging branch.
451
472
- name : Checkout staging branch
452
473
uses : actions/checkout@v4
453
- with :
454
- ref : staging
455
- token : ${{ secrets.OS_BOTIFY_TOKEN }}
456
-
457
- - name : Setup git for OSBotify
458
- uses : ./.github/actions/composite/setupGitForOSBotifyApp
459
- id : setupGitForOSBotify
460
- with :
461
- GPG_PASSPHRASE : ${{ secrets.LARGE_SECRET_PASSPHRASE }}
462
- OS_BOTIFY_APP_ID : ${{ secrets.OS_BOTIFY_APP_ID }}
463
- OS_BOTIFY_PRIVATE_KEY : ${{ secrets.OS_BOTIFY_PRIVATE_KEY }}
464
474
465
475
- name : Get current app version
466
- run : echo "STAGING_VERSION=$(npm run print- version --silent )" >> "$GITHUB_ENV"
476
+ run : echo "STAGING_VERSION=$(jq -r . version < package.json )" >> "$GITHUB_ENV"
467
477
468
478
- name : Download all workflow run artifacts
469
479
uses : actions/download-artifact@v4
470
480
471
481
- name : 🚀 Create prerelease 🚀
472
482
run : gh release create ${{ env.STAGING_VERSION }} --title ${{ env.STAGING_VERSION }} --generate-notes --prerelease --target staging
473
483
env :
474
- GITHUB_TOKEN : ${{ steps.setupGitForOSBotify.outputs.OS_BOTIFY_API_TOKEN }}
484
+ GITHUB_TOKEN : ${{ github.token }}
475
485
476
486
- name : Upload artifacts to GitHub Release
477
487
run : |
@@ -486,7 +496,7 @@ jobs:
486
496
./web-build-tar-gz/webBuild.tar.gz \
487
497
./web-build-zip/webBuild.zip
488
498
env :
489
- GITHUB_TOKEN : ${{ github.token }}
499
+ GITHUB_TOKEN : ${{ github.token }}
490
500
491
501
- name : Warn deployers if staging deploy failed
492
502
if : ${{ failure() }}
@@ -513,17 +523,6 @@ jobs:
513
523
steps :
514
524
- uses : actions/checkout@v4
515
525
name : Checkout
516
- with :
517
- ref : production
518
- token : ${{ secrets.OS_BOTIFY_TOKEN }}
519
-
520
- - name : Setup git for OSBotify
521
- uses : ./.github/actions/composite/setupGitForOSBotifyApp
522
- id : setupGitForOSBotify
523
- with :
524
- GPG_PASSPHRASE : ${{ secrets.LARGE_SECRET_PASSPHRASE }}
525
- OS_BOTIFY_APP_ID : ${{ secrets.OS_BOTIFY_APP_ID }}
526
- OS_BOTIFY_PRIVATE_KEY : ${{ secrets.OS_BOTIFY_PRIVATE_KEY }}
527
526
528
527
- name : Get current app version
529
528
run : echo "PRODUCTION_VERSION=$(npm run print-version --silent)" >> "$GITHUB_ENV"
@@ -537,15 +536,15 @@ jobs:
537
536
./web-build-tar-gz/webBuild.tar.gz \
538
537
./web-build-zip/webBuild.zip
539
538
env :
540
- GITHUB_TOKEN : ${{ github.token }}
539
+ GITHUB_TOKEN : ${{ github.token }}
541
540
542
541
- name : 🚀 Edit the release to be no longer a prerelease 🚀
543
542
run : |
544
543
LATEST_RELEASE="$(gh release list --exclude-pre-releases --json tagName,isLatest --jq '.[] | select(.isLatest) | .tagName')"
545
544
gh api --method POST /repos/Expensify/App/releases/generate-notes -f "tag_name=${{ env.PRODUCTION_VERSION }}" -f "previous_tag_name=$LATEST_RELEASE" | jq -r '.body' >> releaseNotes.md
546
545
gh release edit ${{ env.PRODUCTION_VERSION }} --prerelease=false --latest --notes-file releaseNotes.md
547
546
env :
548
- GITHUB_TOKEN : ${{ steps.setupGitForOSBotify.outputs.OS_BOTIFY_API_TOKEN }}
547
+ GITHUB_TOKEN : ${{ github.token }}
549
548
550
549
- name : Warn deployers if production deploy failed
551
550
if : ${{ failure() }}
0 commit comments