Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 31 additions & 4 deletions .github/workflows/test-auto-generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,18 @@ jobs:
echo "📋 Generated files in test-${{ matrix.api_version }}/:"
ls -la ./test-${{ matrix.api_version }}/

- name: Upload artifacts
- name: Upload SDK artifacts
uses: actions/upload-artifact@v4
with:
name: test-generated-${{ matrix.api_version }}
path: ./test-${{ matrix.api_version }}

- name: Upload config artifact (for version bump persistence)
uses: actions/upload-artifact@v4
with:
name: test-config-${{ matrix.api_version }}
path: ${{ matrix.config_file }}

Process-and-Push:
runs-on: ubuntu-latest
needs: [Setup, Generate]
Expand All @@ -157,6 +163,22 @@ jobs:
with:
path: ./test-generated

- name: Restore config files from artifacts
run: |
echo "📋 Restoring config files from artifacts..."
if [ -d "./test-generated/test-config-v20111101" ]; then
echo "📋 Restoring test-config-v20111101.yml"
cp ./test-generated/test-config-v20111101/* ./openapi/test-config-v20111101.yml 2>/dev/null || echo " (file not found in artifact)"
fi
if [ -d "./test-generated/test-config-v20250224" ]; then
echo "📋 Restoring test-config-v20250224.yml"
cp ./test-generated/test-config-v20250224/* ./openapi/test-config-v20250224.yml 2>/dev/null || echo " (file not found in artifact)"
fi
echo "📋 Config files after restoration:"
cat ./openapi/test-config-v20111101.yml 2>/dev/null || echo " test-config-v20111101.yml not available"
echo "---"
cat ./openapi/test-config-v20250224.yml 2>/dev/null || echo " test-config-v20250224.yml not available"

- name: Move generated files and track versions
id: track_versions
run: |
Expand Down Expand Up @@ -213,9 +235,13 @@ jobs:
cp CHANGELOG.md CHANGELOG.md.bak
cp TEST-CHANGELOG.md CHANGELOG.md

VERSIONS_CSV=$(echo "$GENERATED_VERSIONS" | xargs | tr ' ' ',')
echo "📋 Updating TEST-CHANGELOG for versions: $VERSIONS_CSV"
ruby .github/changelog_manager.rb "$VERSIONS_CSV"
# *** ISSUE 2 FIX: Pass test directory names to changelog_manager.rb ***
# Instead of "v20111101", pass "test-v20111101" so changelog_manager reads from
# test-v20111101/package.json (version 98.1.0) not v20111101/package.json (version 2.0.0)
TEST_VERSIONS_CSV=$(echo "$GENERATED_VERSIONS" | xargs | sed 's/v20111101/test-v20111101/g' | sed 's/v20250224/test-v20250224/g' | tr ' ' ',')
echo "📋 Updating TEST-CHANGELOG for versions: $TEST_VERSIONS_CSV"
echo "📋 (directory names: converting api versions to test- prefixed directories)"
ruby .github/changelog_manager.rb "$TEST_VERSIONS_CSV"

# Move updated changelog to TEST-CHANGELOG and restore real one
cp CHANGELOG.md TEST-CHANGELOG.md
Expand Down Expand Up @@ -261,6 +287,7 @@ jobs:
with:
token: ${{ steps.generate_token.outputs.token }}
event-type: test_push_to_branch
client-payload: '{"versions": "${{ needs.Setup.outputs.versions_to_generate }}"}'

- name: Summary
run: |
Expand Down
37 changes: 33 additions & 4 deletions .github/workflows/test-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,51 @@ jobs:
echo "✅ No skip flag - proceeding with publish/release"
fi

# Detect which test API versions were modified in this push
# Detect which test API versions were modified
# On repository_dispatch: versions come from client payload (paths-filter can't
# detect changes correctly because dispatch runs on master, not test-auto-generate)
# On push: use paths-filter as normal (push events have correct git context)
# NOTE: This is a SANDBOX-ONLY workaround. Production on-push-master.yml does NOT
# need this because both push and dispatch target master (same branch = correct context).
detect-changes:
runs-on: ubuntu-latest
outputs:
test_v20111101: ${{ steps.filter.outputs.test_v20111101 }}
test_v20250224: ${{ steps.filter.outputs.test_v20250224 }}
test_v20111101: ${{ steps.result.outputs.test_v20111101 }}
test_v20250224: ${{ steps.result.outputs.test_v20250224 }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
- name: Detect from dispatch payload
id: dispatch
if: github.event_name == 'repository_dispatch'
run: |
VERSIONS="${{ github.event.client_payload.versions }}"
echo "📋 Dispatch payload versions: $VERSIONS"
[[ "$VERSIONS" == *"v20111101"* ]] && echo "test_v20111101=true" >> $GITHUB_OUTPUT || echo "test_v20111101=false" >> $GITHUB_OUTPUT
[[ "$VERSIONS" == *"v20250224"* ]] && echo "test_v20250224=true" >> $GITHUB_OUTPUT || echo "test_v20250224=false" >> $GITHUB_OUTPUT
- name: Detect from push paths
id: filter
if: github.event_name == 'push'
uses: dorny/paths-filter@v2
with:
filters: |
test_v20111101:
- 'test-v20111101/**'
test_v20250224:
- 'test-v20250224/**'
- name: Set outputs
id: result
run: |
if [ "${{ github.event_name }}" = "repository_dispatch" ]; then
echo "test_v20111101=${{ steps.dispatch.outputs.test_v20111101 }}" >> $GITHUB_OUTPUT
echo "test_v20250224=${{ steps.dispatch.outputs.test_v20250224 }}" >> $GITHUB_OUTPUT
echo "📋 Using dispatch-based detection"
else
echo "test_v20111101=${{ steps.filter.outputs.test_v20111101 }}" >> $GITHUB_OUTPUT
echo "test_v20250224=${{ steps.filter.outputs.test_v20250224 }}" >> $GITHUB_OUTPUT
echo "📋 Using paths-filter-based detection"
fi
echo "📋 test_v20111101=${{ steps.dispatch.outputs.test_v20111101 || steps.filter.outputs.test_v20111101 }}"
echo "📋 test_v20250224=${{ steps.dispatch.outputs.test_v20250224 || steps.filter.outputs.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
Expand Down