-
Notifications
You must be signed in to change notification settings - Fork 11
121 lines (108 loc) · 3.75 KB
/
openclaw-release.yml
File metadata and controls
121 lines (108 loc) · 3.75 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
name: Build OpenClaw Image
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
openclawTag:
default: "2026.2.3"
description: "OpenClaw Release Tag 2026.2.3, etc."
required: true
dockerhubTag:
default: "2026.2.3"
description: "Docker Hub Tag"
required: false
platforms:
description: "Platforms"
default: "linux/amd64,linux/arm64/v8"
required: true
pushLatest:
description: "Push latest tag"
default: "true"
required: true
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to Docker Hub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Resolve release metadata
id: meta
shell: bash
env:
EVENT_NAME: ${{ github.event_name }}
INPUT_OPENCLAW_TAG: ${{ github.event.inputs.openclawTag }}
INPUT_DOCKERHUB_TAG: ${{ github.event.inputs.dockerhubTag }}
INPUT_PLATFORMS: ${{ github.event.inputs.platforms }}
INPUT_PUSH_LATEST: ${{ github.event.inputs.pushLatest }}
REF_NAME: ${{ github.ref_name }}
run: |
set -euo pipefail
if [ "$EVENT_NAME" = "workflow_dispatch" ]; then
openclaw_tag="${INPUT_OPENCLAW_TAG}"
dockerhub_tag="${INPUT_DOCKERHUB_TAG:-$openclaw_tag}"
platforms="${INPUT_PLATFORMS:-linux/amd64,linux/arm64/v8}"
push_latest="${INPUT_PUSH_LATEST:-true}"
else
openclaw_tag="${REF_NAME#v}"
dockerhub_tag="$openclaw_tag"
platforms="linux/amd64,linux/arm64/v8"
push_latest="true"
fi
if [ -z "$openclaw_tag" ]; then
echo "::error::Failed to resolve OpenClaw tag"
exit 1
fi
{
echo "openclaw_tag=$openclaw_tag"
echo "dockerhub_tag=$dockerhub_tag"
echo "platforms=$platforms"
echo "push_latest=$push_latest"
} >> "$GITHUB_OUTPUT"
- name: Download Source
run: |
set -euo pipefail
mkdir -p _src/openclaw
curl -fsSL "https://github.com/openclaw/openclaw/archive/refs/tags/v${{ steps.meta.outputs.openclaw_tag }}.tar.gz" \
| tar -xz -C _src/openclaw --strip-components=1
mkdir -p _src/openclaw/openclaw
cp openclaw/Dockerfile openclaw/docker-entrypoint.sh _src/openclaw/openclaw/
- name: Build OpenClaw Image and Push
uses: docker/build-push-action@v7
with:
context: _src/openclaw
file: _src/openclaw/openclaw/Dockerfile
platforms: ${{ steps.meta.outputs.platforms }}
push: true
build-args: |
OPENCLAW_INSTALL_BROWSER=true
tags: |
1panel/openclaw:${{ steps.meta.outputs.dockerhub_tag }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Push Latest Tag
if: ${{ github.event_name == 'push' || steps.meta.outputs.push_latest == 'true' }}
uses: docker/build-push-action@v7
with:
context: _src/openclaw
file: _src/openclaw/openclaw/Dockerfile
platforms: ${{ steps.meta.outputs.platforms }}
push: true
build-args: |
OPENCLAW_INSTALL_BROWSER=true
tags: |
1panel/openclaw:latest
cache-from: type=gha
cache-to: type=gha,mode=max