-
Notifications
You must be signed in to change notification settings - Fork 3
140 lines (130 loc) Β· 5.42 KB
/
test-on-push.yml
File metadata and controls
140 lines (130 loc) Β· 5.42 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
name: "TEST: On Push to Test Branch"
# ============================================================================
# SANDBOX TEST WORKFLOW - Phase 8A
# Mirrors on-push-master.yml but tracks test-auto-generate branch and test
# directories. Publish/release jobs echo success instead of real actions.
# Incorporates fix for Issue 6 (env block for commit message).
# DELETE THIS FILE after Phase 8A testing is complete.
# ============================================================================
on:
push:
branches: [test-auto-generate]
paths:
- 'test-v20111101/**'
- 'test-v20250224/**'
repository_dispatch:
types: [test_push_to_branch]
jobs:
# Check for skip-publish flag in commit message
# *** ISSUE 6 FIX: Uses env block instead of inline interpolation ***
check-skip-publish:
runs-on: ubuntu-latest
outputs:
skip_publish: ${{ steps.check.outputs.skip_publish }}
steps:
- name: Check for [skip-publish] flag in commit message
id: check
env:
COMMIT_MSG: ${{ github.event.head_commit.message }}
run: |
echo "π Commit message: $COMMIT_MSG"
if [[ "$COMMIT_MSG" == *"[skip-publish]"* ]]; then
echo "skip_publish=true" >> $GITHUB_OUTPUT
echo "π« [skip-publish] flag detected - skipping all publish/release jobs"
else
echo "skip_publish=false" >> $GITHUB_OUTPUT
echo "β
No skip flag - proceeding with publish/release"
fi
# Detect which test API versions were modified in this push
detect-changes:
runs-on: ubuntu-latest
outputs:
test_v20111101: ${{ steps.filter.outputs.test_v20111101 }}
test_v20250224: ${{ steps.filter.outputs.test_v20250224 }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
test_v20111101:
- 'test-v20111101/**'
test_v20250224:
- 'test-v20250224/**'
# Simulated publish and release for each version conditionally
# Same conditional structure as production but echoes success instead of real npm publish/GitHub release
publish-test-v20111101:
needs: [check-skip-publish, detect-changes]
if: needs.check-skip-publish.outputs.skip_publish == 'false' && needs.detect-changes.outputs.test_v20111101 == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: test-auto-generate
- name: Simulate publish
run: |
VERSION=$(jq -r '.version' ./test-v20111101/package.json)
echo "============================================"
echo "β
PUBLISH SUCCESS (simulated)"
echo " Package: mx-platform-node@$VERSION"
echo " Directory: test-v20111101/"
echo " Would run: npm publish from test-v20111101/"
echo "============================================"
release-test-v20111101:
needs: [check-skip-publish, detect-changes, publish-test-v20111101]
if: needs.check-skip-publish.outputs.skip_publish == 'false' && needs.detect-changes.outputs.test_v20111101 == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: test-auto-generate
- name: Simulate release
run: |
VERSION=$(jq -r '.version' ./test-v20111101/package.json)
echo "============================================"
echo "β
RELEASE SUCCESS (simulated)"
echo " Tag: v$VERSION"
echo " Directory: test-v20111101/"
echo " Would create: GitHub release for v$VERSION"
echo "============================================"
delay-for-test-v20250224:
runs-on: ubuntu-latest
needs: [check-skip-publish, detect-changes]
if: needs.check-skip-publish.outputs.skip_publish == 'false'
steps:
- name: Brief delay to stagger v20250224 publish
run: sleep 2
publish-test-v20250224:
needs: [check-skip-publish, detect-changes, delay-for-test-v20250224]
if: needs.check-skip-publish.outputs.skip_publish == 'false' && needs.detect-changes.outputs.test_v20250224 == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: test-auto-generate
- name: Simulate publish
run: |
VERSION=$(jq -r '.version' ./test-v20250224/package.json)
echo "============================================"
echo "β
PUBLISH SUCCESS (simulated)"
echo " Package: mx-platform-node@$VERSION"
echo " Directory: test-v20250224/"
echo " Would run: npm publish from test-v20250224/"
echo "============================================"
release-test-v20250224:
needs: [check-skip-publish, detect-changes, publish-test-v20250224]
if: needs.check-skip-publish.outputs.skip_publish == 'false' && needs.detect-changes.outputs.test_v20250224 == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: test-auto-generate
- name: Simulate release
run: |
VERSION=$(jq -r '.version' ./test-v20250224/package.json)
echo "============================================"
echo "β
RELEASE SUCCESS (simulated)"
echo " Tag: v$VERSION"
echo " Directory: test-v20250224/"
echo " Would create: GitHub release for v$VERSION"
echo "============================================"