Skip to content

Commit d3837c6

Browse files
authored
Merge pull request #48671 from Expensify/Rory-FixChecklistUpdates
[No QA] Create and push tag before updating checklist
2 parents 2778eee + 94cf03d commit d3837c6

File tree

1 file changed

+30
-31
lines changed

1 file changed

+30
-31
lines changed

.github/workflows/deploy.yml

+30-31
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,35 @@ jobs:
2828
env:
2929
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}
3030

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+
3154
# Note: we're updating the checklist before running the deploys and assuming that it will succeed on at least one platform
3255
deployChecklist:
3356
name: Create or update deploy checklist
3457
uses: ./.github/workflows/createDeployChecklist.yml
3558
if: ${{ github.ref == 'refs/heads/staging' }}
36-
needs: validateActor
59+
needs: createTag
3760
secrets: inherit
3861

3962
android:
@@ -45,7 +68,7 @@ jobs:
4568
steps:
4669
- name: Checkout
4770
uses: actions/checkout@v4
48-
71+
4972
- name: Configure MapBox SDK
5073
run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }}
5174

@@ -446,32 +469,19 @@ jobs:
446469
if: ${{ github.ref == 'refs/heads/staging' && fromJSON(needs.checkDeploymentSuccess.outputs.IS_AT_LEAST_ONE_PLATFORM_DEPLOYED) }}
447470
needs: [checkDeploymentSuccess]
448471
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.
451472
- name: Checkout staging branch
452473
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 }}
464474

465475
- 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"
467477

468478
- name: Download all workflow run artifacts
469479
uses: actions/download-artifact@v4
470480

471481
- name: 🚀 Create prerelease 🚀
472482
run: gh release create ${{ env.STAGING_VERSION }} --title ${{ env.STAGING_VERSION }} --generate-notes --prerelease --target staging
473483
env:
474-
GITHUB_TOKEN: ${{ steps.setupGitForOSBotify.outputs.OS_BOTIFY_API_TOKEN }}
484+
GITHUB_TOKEN: ${{ github.token }}
475485

476486
- name: Upload artifacts to GitHub Release
477487
run: |
@@ -486,7 +496,7 @@ jobs:
486496
./web-build-tar-gz/webBuild.tar.gz \
487497
./web-build-zip/webBuild.zip
488498
env:
489-
GITHUB_TOKEN: ${{ github.token }}
499+
GITHUB_TOKEN: ${{ github.token }}
490500

491501
- name: Warn deployers if staging deploy failed
492502
if: ${{ failure() }}
@@ -513,17 +523,6 @@ jobs:
513523
steps:
514524
- uses: actions/checkout@v4
515525
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 }}
527526

528527
- name: Get current app version
529528
run: echo "PRODUCTION_VERSION=$(npm run print-version --silent)" >> "$GITHUB_ENV"
@@ -537,15 +536,15 @@ jobs:
537536
./web-build-tar-gz/webBuild.tar.gz \
538537
./web-build-zip/webBuild.zip
539538
env:
540-
GITHUB_TOKEN: ${{ github.token }}
539+
GITHUB_TOKEN: ${{ github.token }}
541540

542541
- name: 🚀 Edit the release to be no longer a prerelease 🚀
543542
run: |
544543
LATEST_RELEASE="$(gh release list --exclude-pre-releases --json tagName,isLatest --jq '.[] | select(.isLatest) | .tagName')"
545544
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
546545
gh release edit ${{ env.PRODUCTION_VERSION }} --prerelease=false --latest --notes-file releaseNotes.md
547546
env:
548-
GITHUB_TOKEN: ${{ steps.setupGitForOSBotify.outputs.OS_BOTIFY_API_TOKEN }}
547+
GITHUB_TOKEN: ${{ github.token }}
549548

550549
- name: Warn deployers if production deploy failed
551550
if: ${{ failure() }}

0 commit comments

Comments
 (0)