-
Notifications
You must be signed in to change notification settings - Fork 0
209 lines (180 loc) · 6.39 KB
/
Copy pathwork1.yml
File metadata and controls
209 lines (180 loc) · 6.39 KB
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
name: Use Hello Action 1
on:
pull_request:
workflow_dispatch:
jobs:
greet:
runs-on: ubuntu-latest
permissions:
pull-requests: write
actions: write
contents: write
packages: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Get version from action1
id: get-metadata
uses: ./.github/actions/eas/action1
- name: Print version from action1
run: |
echo "The version is ${{ steps.get-metadata.outputs.version }}"
- name: Get diff from js
run: |
echo "Diff before"
node git-diff.js
echo "Diff after"
- name: Github script to create tags
uses: actions/github-script@v7
with:
script: |
const refObject = {
owner: context.repo.owner,
repo: context.repo.repo,
sha: context.sha
};
# const something = await github.rest.git.createRef({
# ...refObject,
# ref: `refs/tags/mojtag/2${context.sha}`,
# })
# console.log(`Adding git tag 🎯.`, something);
determine_matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.result }}
steps:
- name: Set Matrix
id: set-matrix
uses: actions/github-script@v7
with:
script: |
const variants = [];
variants.push({ platform: 'ios', profile: 'betaautomation' });
variants.push({ platform: 'android', profile: 'production' });
variants.push({ platform: 'android', profile: 'productioniap' });
// Set the final matrix
const matrix = { include: variants };
console.log('Matrix:', matrix);
console.log('Matrix JSON:', JSON.stringify(matrix));
return matrix;
log_matrix:
needs: determine_matrix
name: Log Matrix
runs-on: ubuntu-latest
permissions:
pull-requests: write
actions: write
contents: read
packages: write
steps:
- name: Print matrix
run: |
echo "Matrix not toJson: ${{ needs.determine_matrix.outputs.matrix }}"
echo "Matrix from json: ${{ fromJson(needs.determine_matrix.outputs.matrix) }}"
- name: jq 1
run: |
echo "${{ needs.determine_matrix.outputs.matrix }}" | jq -c '.'
- name: jq 2
run: |
echo "${{ toJson(needs.determine_matrix.outputs.matrix) }}" | jq -c '.'
build_and_submit:
needs: determine_matrix
name: Build and Submit
runs-on: ubuntu-latest
permissions:
pull-requests: write
actions: write
contents: read
packages: write
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.determine_matrix.outputs.matrix) }}
steps:
- name: Print matrix
run: |
echo "Matrix profile: ${{ matrix.profile }}"
echo "Matrix platform: ${{ matrix.platform }}"
# example_job_second:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# with:
# fetch-depth: 2
# - name: Get commit message header
# id: get_commit_message
# run: |
# COMMIT_MESSAGE_HEADER=$(git log --format=%B -n 1 ${{ github.event.pull_request.head.sha }})
# echo "COMMIT_MESSAGE_HEADER=${COMMIT_MESSAGE_HEADER}" >> $GITHUB_ENV
# - name: Use commit message header
# run: |
# echo "The commit message header is: $COMMIT_MESSAGE_HEADER"
# echo "The other method resolves to: ${{ github.event.head_commit.message }}"
# example_job_third:
# runs-on: ubuntu-latest
# env:
# COMMIT_MESSAGE_HEADER: Revert "[MOB] (PMO-16142) - Fix delay when revisiting tabs (#25207)"
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# with:
# fetch-depth: 2
# - name: Get commit message header
# id: get_commit_message
# run: |
# COMMIT_MSG='Revert "[MOB] (PMO-16142) - Fix delay when revisiting tabs (#25207)"'
# echo "RESULT: $COMMIT_MSG"
# # echo "COMMIT_MESSAGE_HEADER=$COMMIT_MSG" >> $GITHUB_ENV
# echo "result=$COMMIT_MSG" >> "$GITHUB_OUTPUT"
# # - name: Use commit message header1
# # run: |
# # echo "step 1 start"
# # echo "RESULT: ${{ steps.get_commit_message.outputs.result }}"
# # echo "Finish 1"
# - name: Use commit message header2
# run: |
# echo "step 2 start"
# echo "The commit message header is: $COMMIT_MESSAGE_HEADER"
# echo "Finish 2"
# - name: Use commit message header3
# run: |
# echo "step 3 start"
# echo "The commit message header is: ${{ env.COMMIT_MESSAGE_HEADER }}"
# echo "Finish 3"
# example_job_4:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# with:
# fetch-depth: 2
# - name: 🏗 Setup EAS
# uses: expo/expo-github-action@v8
# with:
# eas-version: latest
# token: ${{ secrets.EXPO_TOKEN }}
# - name: Set commit message
# run: |
# COMMIT_MSG='Revert "[MOB] (PMO-16142) - Fix delay when revisiting tabs (#25207)"'
# {
# echo "COMMIT_MESSAGE_HEADER<<EOF"
# echo "$COMMIT_MSG" | sed 's/"/\\"/g'
# echo "EOF"
# } >> $GITHUB_ENV
# - name: Use commit message header 2
# run: |
# echo "step 2 start"
# echo "The commit message header is: $COMMIT_MESSAGE_HEADER"
# echo "Finish 2"
# # SAFE_MESSAGE=$(echo "${{ env.COMMIT_MESSAGE_HEADER }}" | sed 's/"/\\"/g')
# # echo "SAFE_MESSAGE=$SAFE_MESSAGE" >> "$GITHUB_ENV"
# - name: Install dependencies
# run: yarn install
# - name: Create preview
# uses: expo/expo-github-action/preview@v8
# with:
# working-directory: packages/AppOne
# command: eas update --platform android --channel development --message "${{ env.COMMIT_MESSAGE_HEADER }}"
# env:
# NODE_OPTIONS: --max-old-space-size=4096