-
Notifications
You must be signed in to change notification settings - Fork 37
265 lines (214 loc) · 8.11 KB
/
daily-build.yml
File metadata and controls
265 lines (214 loc) · 8.11 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
name: Daily Build
on:
schedule:
# Run at 00:00 UTC every day
- cron: '0 0 * * *'
workflow_dispatch: # Allow manual trigger
permissions:
contents: write
jobs:
build:
name: Build for ${{ matrix.os }}-${{ matrix.arch }}
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
# Linux builds
- os: linux
arch: amd64
runner: ubuntu-latest
- os: linux
arch: arm64
runner: ubuntu-24.04-arm
# macOS builds
- os: darwin
arch: amd64
runner: macos-latest
- os: darwin
arch: arm64
runner: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25.1'
cache-dependency-path: agfs-server/go.sum
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install uv
shell: bash
run: |
if [ "${{ matrix.os }}" = "windows" ]; then
# For Windows, use PowerShell installer
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
echo "$HOME/AppData/Roaming/Python/Scripts" >> $GITHUB_PATH
else
# For Unix
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
fi
- name: Get version info
id: version
shell: bash
run: |
echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Build agfs-server
working-directory: agfs-server
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
CGO_ENABLED: 0
run: |
go build -ldflags="-s -w -X main.version=${{ steps.version.outputs.date }}-${{ steps.version.outputs.short_sha }}" -o ../build/agfs-server-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.os == 'windows' && '.exe' || '' }} ./cmd/server
- name: Build agfs-shell (portable)
if: matrix.arch == 'amd64' || matrix.arch == 'arm64'
shell: bash
run: |
cd agfs-shell
# Find uv command
if command -v uv &> /dev/null; then
UV_CMD="uv"
elif [ -f "$HOME/.cargo/bin/uv" ]; then
UV_CMD="$HOME/.cargo/bin/uv"
else
echo "Error: uv not found"
exit 1
fi
echo "Using uv: $UV_CMD"
$UV_CMD --version
# Sync dependencies
$UV_CMD sync
# Build portable distribution
python3 build.py
# Create archive name
ARCHIVE_NAME="agfs-shell-${{ matrix.os }}-${{ matrix.arch }}"
# Package the portable distribution
if [ "${{ matrix.os }}" = "windows" ]; then
# For Windows, create zip
cd dist
powershell Compress-Archive -Path agfs-shell-portable -DestinationPath "../../build/${ARCHIVE_NAME}.zip"
else
# For Unix, create tar.gz
cd dist
tar -czf "../../build/${ARCHIVE_NAME}.tar.gz" agfs-shell-portable/
fi
- name: Create archive (Unix)
if: matrix.os != 'windows'
working-directory: build
run: |
tar -czf agfs-${{ matrix.os }}-${{ matrix.arch }}-${{ steps.version.outputs.date }}.tar.gz agfs-server-${{ matrix.os }}-${{ matrix.arch }}*
- name: Create archive (Windows)
if: matrix.os == 'windows'
working-directory: build
shell: pwsh
run: |
$files = Get-ChildItem -Filter "agfs-*-${{ matrix.os }}-${{ matrix.arch }}*"
Compress-Archive -Path $files -DestinationPath "agfs-${{ matrix.os }}-${{ matrix.arch }}-${{ steps.version.outputs.date }}.zip"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: agfs-${{ matrix.os }}-${{ matrix.arch }}
path: |
build/agfs-${{ matrix.os }}-${{ matrix.arch }}-*.tar.gz
build/agfs-${{ matrix.os }}-${{ matrix.arch }}-*.zip
build/agfs-shell-${{ matrix.os }}-${{ matrix.arch }}.tar.gz
build/agfs-shell-${{ matrix.os }}-${{ matrix.arch }}.zip
retention-days: 90
create-release:
name: Create Daily Release
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get version info
id: version
run: |
echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
echo "tag=nightly" >> $GITHUB_OUTPUT
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: release-artifacts
- name: Display structure of downloaded files
run: ls -R release-artifacts
- name: Prepare release assets
run: |
mkdir -p release
find release-artifacts -type f \( -name "*.tar.gz" -o -name "*.zip" \) -exec cp {} release/ \;
- name: Delete existing nightly release
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release delete nightly --yes --cleanup-tag
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: nightly
name: Nightly Build (${{ steps.version.outputs.date }})
body: |
## Daily Build - ${{ steps.version.outputs.date }}
Automated daily build from commit ${{ github.sha }}
### 📦 What's Included
This release contains:
- **agfs-server**: Go binary (server)
- **agfs-shell**: Python portable CLI with Unix-style pipeline support (requires Python 3.8+, includes all dependencies)
### Downloads
#### Server Binaries
- **Linux AMD64**: `agfs-linux-amd64-${{ steps.version.outputs.date }}.tar.gz`
- **Linux ARM64**: `agfs-linux-arm64-${{ steps.version.outputs.date }}.tar.gz`
- **macOS AMD64**: `agfs-darwin-amd64-${{ steps.version.outputs.date }}.tar.gz`
- **macOS ARM64 (Apple Silicon)**: `agfs-darwin-arm64-${{ steps.version.outputs.date }}.tar.gz`
#### CLI Client (Portable, Python 3.8+ required)
- **Linux AMD64**: `agfs-shell-linux-amd64.tar.gz`
- **Linux ARM64**: `agfs-shell-linux-arm64.tar.gz`
- **macOS AMD64**: `agfs-shell-darwin-amd64.tar.gz`
- **macOS ARM64**: `agfs-shell-darwin-arm64.tar.gz`
### Installation
#### Quick Install (All-in-One)
```bash
curl -fsSL https://raw.githubusercontent.com/c4pt0r/agfs/master/install.sh | sh
```
This will install both server and client to `~/.local/bin/`.
#### Manual Installation
**Server (Linux/macOS):**
```bash
# Extract
tar -xzf agfs-<os>-<arch>-${{ steps.version.outputs.date }}.tar.gz
# Make executable
chmod +x agfs-server-<os>-<arch>
# Move to bin directory
mv agfs-server-<os>-<arch> ~/.local/bin/agfs-server
# Run server
agfs-server
```
**Client (Linux/macOS):**
```bash
# Extract
tar -xzf agfs-shell-<os>-<arch>.tar.gz
# Run directly
./agfs-shell-portable/agfs-shell
# Or add to PATH
export PATH=$PATH:$(pwd)/agfs-shell-portable
```
### Quick Start
```bash
# Start the server
agfs-server
# In another terminal, use CLI with Unix-style pipelines
agfs-shell
# Then run commands like:
# cat /etc/hosts | grep localhost
# ls / | grep etc
```
files: release/*
draft: false
prerelease: true