-
Notifications
You must be signed in to change notification settings - Fork 2.9k
111 lines (97 loc) · 3.91 KB
/
lockDeploys.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Lock staging deploys during QA
on:
issues:
types: [labeled]
jobs:
lockStagingDeploys:
if: ${{ github.event.label.name == '🔐 LockCashDeploys 🔐' && contains(github.event.issue.labels.*.name, 'StagingDeployCash') && github.actor != 'OSBotify' }}
runs-on: macos-latest
steps:
# Version: 2.3.4
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
ref: main
fetch-depth: 0
token: ${{ secrets.OS_BOTIFY_TOKEN }}
- name: Wait for any preDeploy version jobs to finish
uses: tomchv/wait-my-workflow@2da0b8a92211e6d7c9964602b99a7052080a1d61
with:
token: ${{ secrets.GITHUB_TOKEN }}
checkName: version
intervalSeconds: 10
timeoutSeconds: 360
- name: Wait for any automerge jobs to start
run: sleep 60
- name: Wait for any automerge-main jobs to finish
uses: tomchv/wait-my-workflow@2da0b8a92211e6d7c9964602b99a7052080a1d61
with:
token: ${{ secrets.GITHUB_TOKEN }}
checkName: main
intervalSeconds: 10
timeoutSeconds: 150
- uses: softprops/turnstyle@8db075d65b19bf94e6e8687b504db69938dc3c65
with:
poll-interval-seconds: 10
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create a new branch
run: |
git config user.name OSBotify
git pull origin main
git checkout -b version-patch-${{ github.sha }}
git push --set-upstream origin version-patch-${{ github.sha }}
- name: Generate version
id: bumpVersion
uses: Expensify/Expensify.cash/.github/actions/bumpVersion@main
with:
SEMVER_LEVEL: PATCH
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}
- name: Commit new version
run: |
git add \
./package.json \
./package-lock.json \
./android/app/build.gradle \
./ios/ExpensifyCash/Info.plist \
./ios/ExpensifyCashTests/Info.plist
git commit -m "Update version to ${{ steps.bumpVersion.outputs.NEW_VERSION }}"
- name: Create Pull Request (main)
uses: peter-evans/create-pull-request@09b9ac155b0d5ad7d8d157ed32158c1b73689109
with:
token: ${{ secrets.OS_BOTIFY_TOKEN }}
author: OSBotify <reactnative@expensify.com>
base: main
branch: version-patch-${{ github.sha }}
title: Update version to ${{ steps.bumpVersion.outputs.NEW_VERSION }} on main
body: Update version to ${{ steps.bumpVersion.outputs.NEW_VERSION }}
labels: automerge
- name: Tag version
run: git tag ${{ steps.bumpVersion.outputs.NEW_VERSION }}
# TODO: Once we add cherry picking, we will need run this from the deploy workflow
- name: 🚀 Push tags to trigger staging deploy 🚀
run: git push --tags
- name: Update StagingDeployCash
uses: Expensify/Expensify.cash/.github/actions/createOrUpdateStagingDeploy@main
with:
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}
NPM_VERSION: ${{ steps.bumpVersion.outputs.NEW_VERSION }}
# This Slack step is duplicated in all workflows, if you make a change to this step, make sure to update all
# the other workflows with the same change
- uses: 8398a7/action-slack@v3
name: Job failed Slack notification
if: ${{ failure() }}
with:
status: custom
fields: workflow, repo
custom_payload: |
{
channel: '#announce',
attachments: [{
color: "#DB4545",
pretext: `<!here>`,
text: `💥 ${process.env.AS_REPO} failed on ${process.env.AS_WORKFLOW} workflow 💥`,
}]
}
env:
GITHUB_TOKEN: ${{ github.token }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}