Skip to content

Commit b25d70f

Browse files
hcastc00claude
andcommitted
ci: use dappnodesdk bump-upstream and add Pinata secrets for IPFS hash comments
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 962d5a7 commit b25d70f

2 files changed

Lines changed: 13 additions & 60 deletions

File tree

.github/workflows/auto_check.yml

Lines changed: 6 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -10,59 +10,11 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v4
1314
with:
14-
fetch-depth: 0
15-
16-
- name: Get current upstream version
17-
id: current
18-
run: |
19-
VERSION=$(jq -r '.upstreamVersion' dappnode_package.json)
20-
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
21-
22-
- name: Fetch latest npm version
23-
id: upstream
24-
run: |
25-
LATEST=$(npm view openclaw version)
26-
echo "version=$LATEST" >> "$GITHUB_OUTPUT"
27-
28-
- name: Check if update is needed
29-
id: check
30-
run: |
31-
if [ "${{ steps.current.outputs.version }}" = "${{ steps.upstream.outputs.version }}" ]; then
32-
echo "changed=false" >> "$GITHUB_OUTPUT"
33-
else
34-
echo "changed=true" >> "$GITHUB_OUTPUT"
35-
fi
36-
37-
- name: Update upstream version in dappnode_package.json
38-
if: steps.check.outputs.changed == 'true'
39-
run: |
40-
VERSION=${{ steps.upstream.outputs.version }}
41-
jq --arg v "$VERSION" '.upstreamVersion = $v' dappnode_package.json > tmp.json && mv tmp.json dappnode_package.json
42-
43-
- name: Create PR
44-
if: steps.check.outputs.changed == 'true'
15+
node-version: "22"
16+
- run: npx @dappnode/dappnodesdk github-action bump-upstream
4517
env:
46-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47-
run: |
48-
VERSION=${{ steps.upstream.outputs.version }}
49-
BRANCH="bump-upstream/v${VERSION}"
50-
51-
git config user.name "github-actions[bot]"
52-
git config user.email "github-actions[bot]@users.noreply.github.com"
53-
54-
# Check if branch already exists on remote
55-
if git ls-remote --heads origin "$BRANCH" | grep -q "$BRANCH"; then
56-
echo "Branch $BRANCH already exists, skipping"
57-
exit 0
58-
fi
59-
60-
git checkout -b "$BRANCH"
61-
git add dappnode_package.json
62-
git commit -m "Bump openclaw upstream to ${VERSION}"
63-
git push origin "$BRANCH"
64-
65-
gh pr create \
66-
--title "Bump openclaw upstream to ${VERSION}" \
67-
--body "Bumps openclaw npm package to version \`${VERSION}\`." \
68-
--base main
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
PINATA_API_KEY: ${{ secrets.PINATA_API_KEY }}
20+
PINATA_SECRET_API_KEY: ${{ secrets.PINATA_SECRET_API_KEY }}

.github/workflows/main.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,29 @@ on:
33
repository_dispatch:
44
pull_request:
55
push:
6-
branches:
7-
- "main"
8-
- "v[0-9]+.[0-9]+.[0-9]+"
96
paths-ignore:
107
- "README.md"
118

129
jobs:
1310
build-test:
1411
runs-on: ipfs-dev-gateway
1512
name: Build test
16-
if: github.event_name != 'push'
13+
if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref != 'refs/heads/main')
1714
steps:
1815
- uses: actions/checkout@v4
1916
- uses: actions/setup-node@v4
2017
with:
2118
node-version: "22"
22-
- run: npx @dappnode/dappnodesdk build --provider http://10.200.200.7:5001 --timeout 1h
19+
- run: npx @dappnode/dappnodesdk build github-action build --content_provider=http://10.200.200.7:5001 --timeout 1h
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
PINATA_API_KEY: ${{ secrets.PINATA_API_KEY }}
23+
PINATA_SECRET_API_KEY: ${{ secrets.PINATA_SECRET_API_KEY }}
2324

2425
release:
2526
name: Release
2627
runs-on: ipfs-dev-gateway
27-
if: github.event_name == 'push' || github.event_name == 'repository_dispatch'
28+
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'repository_dispatch'
2829
steps:
2930
- uses: actions/checkout@v4
3031
- uses: actions/setup-node@v4

0 commit comments

Comments
 (0)