Repository navigation
141 lines (117 loc) · 5.9 KB
/
Copy pathversion-check.yml
File metadata and controls
141 lines (117 loc) · 5.9 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
name: Version Check
on:
schedule:
- cron: '0 6 1 * *'
workflow_dispatch:
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
check-versions:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Get latest uv version
id: uv
run: |
UV_VERSION=$(curl -s https://api.github.com/repos/astral-sh/uv/releases/latest | jq -r '.tag_name' | sed 's/^v//')
echo "version=$UV_VERSION" >> $GITHUB_OUTPUT
- name: Get latest Node.js version
id: node
run: |
NODE_VERSION=$(curl -sL https://nodejs.org/dist/index.json | jq -r '[.[] | select(.version | startswith("v20") or startswith("v22"))][0].version' | sed 's/^v//')
echo "version=$NODE_VERSION" >> $GITHUB_OUTPUT
- name: Get latest Bun version
id: bun
run: |
BUN_VERSION=$(curl -s https://api.github.com/repos/oven-sh/bun/releases/latest | jq -r '.tag_name' | sed 's/^v//')
echo "version=$BUN_VERSION" >> $GITHUB_OUTPUT
- name: Get latest OpenCode version
id: opencode
run: |
OPENCODE_VERSION=$(curl -s https://api.github.com/repos/opencode/opencode/releases/latest | jq -r '.tag_name' | sed 's/^v//')
echo "version=$OPENCODE_VERSION" >> $GITHUB_OUTPUT
- name: Get latest oh-my-openagent version
id: oh-my-openagent
run: |
OMA_VERSION=$(curl -s https://api.github.com/repos/code-yeongyu/oh-my-openagent/releases/latest | jq -r '.tag_name' | sed 's/^v//')
echo "version=$OMA_VERSION" >> $GITHUB_OUTPUT
- name: Read current VERSIONS.md
id: current
run: |
UV_CURRENT=$(grep '| uv |' VERSIONS.md | awk '{print $4}')
NODE_CURRENT=$(grep '| Node.js |' VERSIONS.md | awk '{print $4}')
BUN_CURRENT=$(grep '| Bun |' VERSIONS.md | awk '{print $4}')
OPENCODE_CURRENT=$(grep '| OpenCode |' VERSIONS.md | awk '{print $4}')
OMA_CURRENT=$(grep '| oh-my-openagent |' VERSIONS.md | awk '{print $4}')
echo "uv_current=$UV_CURRENT" >> $GITHUB_OUTPUT
echo "node_current=$NODE_CURRENT" >> $GITHUB_OUTPUT
echo "bun_current=$BUN_CURRENT" >> $GITHUB_OUTPUT
echo "opencode_current=$OPENCODE_CURRENT" >> $GITHUB_OUTPUT
echo "oma_current=$OMA_CURRENT" >> $GITHUB_OUTPUT
- name: Check for version changes
id: changes
run: |
TODAY=$(date +%Y-%m-%d)
CHANGES=""
if [ "${{ steps.uv.outputs.version }}" != "${{ steps.current.outputs.uv_current }}" ]; then
CHANGES="${CHANGES}- uv: ${{ steps.current.outputs.uv_current }} → ${{ steps.uv.outputs.version }}\n"
fi
if [ "${{ steps.node.outputs.version }}" != "${{ steps.current.outputs.node_current }}" ]; then
CHANGES="${CHANGES}- Node.js: ${{ steps.current.outputs.node_current }} → ${{ steps.node.outputs.version }}\n"
fi
if [ "${{ steps.bun.outputs.version }}" != "${{ steps.current.outputs.bun_current }}" ]; then
CHANGES="${CHANGES}- Bun: ${{ steps.current.outputs.bun_current }} → ${{ steps.bun.outputs.version }}\n"
fi
if [ "${{ steps.opencode.outputs.version }}" != "${{ steps.current.outputs.opencode_current }}" ]; then
CHANGES="${CHANGES}- OpenCode: ${{ steps.current.outputs.opencode_current }} → ${{ steps.opencode.outputs.version }}\n"
fi
if [ "${{ steps.oh-my-openagent.outputs.version }}" != "${{ steps.current.outputs.oma_current }}" ]; then
CHANGES="${CHANGES}- oh-my-openagent: ${{ steps.current.outputs.oma_current }} → ${{ steps.oh-my-openagent.outputs.version }}\n"
fi
if [ -n "$CHANGES" ]; then
echo "has_changes=true" >> $GITHUB_OUTPUT
echo "changes<<CHANGESEOF" >> $GITHUB_OUTPUT
echo "## Version Changes" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo -e "$CHANGES" >> $GITHUB_OUTPUT
echo "Updated on: $TODAY" >> $GITHUB_OUTPUT
echo "CHANGESEOF" >> $GITHUB_OUTPUT
else
echo "has_changes=false" >> $GITHUB_OUTPUT
fi
- name: Update VERSIONS.md and Dockerfile ARGs
if: steps.changes.outputs.has_changes == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
TODAY=$(date +%Y-%m-%d)
printf '# Tested Versions\n\nLast verified: %s\n\n| Tool | Version | Status |\n|------|---------|--------|\n| uv | %s | OK |\n| Node.js | %s | OK |\n| Bun | %s | OK |\n| OpenCode | %s | OK |\n| oh-my-openagent | %s | OK |\n' \
"$TODAY" \
"${{ steps.uv.outputs.version }}" \
"${{ steps.node.outputs.version }}" \
"${{ steps.bun.outputs.version }}" \
"${{ steps.opencode.outputs.version }}" \
"${{ steps.oh-my-openagent.outputs.version }}" > VERSIONS.md
sed -i "s|node-v[0-9.]*-linux-x64\.tar\.gz|node-v${{ steps.node.outputs.version }}-linux-x64.tar.gz|" Dockerfile.cpu
if [ -f Dockerfile.gpu ]; then
sed -i "s|node-v[0-9.]*-linux-x64\.tar\.gz|node-v${{ steps.node.outputs.version }}-linux-x64.tar.gz|" Dockerfile.gpu
fi
- name: Create Pull Request
if: steps.changes.outputs.has_changes == 'true'
uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'chore: update tool versions'
title: 'chore: update tool versions'
body: |
${{ steps.changes.outputs.changes }}
This PR was automatically created by the version check workflow.
branch: feat/update-versions
delete-branch: true
labels: |
dependencies
automated