-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (67 loc) · 2.77 KB
/
Copy pathupdate-comms-sdk.yml
File metadata and controls
82 lines (67 loc) · 2.77 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
name: Update Comms SDK
on:
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
update-comms-sdk:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install current dependencies
run: npm ci
- name: Update @doist/comms-sdk to latest
run: npm install @doist/comms-sdk@latest
- name: Build
run: npm run build
- name: Run tests
run: npm test
- name: Type check
run: npm run type-check
- name: Lint & format check
run: npm run lint:check
- name: Check for changes
id: changes
run: |
if git diff --quiet package.json package-lock.json; then
echo "No updates available - @doist/comms-sdk is already at the latest version"
echo "has_changes=false" >> $GITHUB_OUTPUT
else
echo "Changes detected - @doist/comms-sdk has been updated"
echo "has_changes=true" >> $GITHUB_OUTPUT
fi
- name: Commit and push changes
if: steps.changes.outputs.has_changes == 'true'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add package.json package-lock.json
git commit -m "fix(deps): update to latest \`@doist/comms-sdk\` package"
git push
- name: Trigger release workflow
if: steps.changes.outputs.has_changes == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "🚀 Triggering release workflow..."
gh workflow run release.yml
echo "✅ Release workflow triggered successfully"
- name: Report success
run: |
if [ "${{ steps.changes.outputs.has_changes }}" == "true" ]; then
echo "✅ Successfully updated @doist/comms-sdk package"
echo "📦 Changes committed to main branch"
echo "🚀 Release workflow triggered - semantic release will create a new patch version"
else
echo "ℹ️ No updates needed - @doist/comms-sdk is already at the latest version"
fi