-
Notifications
You must be signed in to change notification settings - Fork 0
600 lines (516 loc) · 23.2 KB
/
Copy pathcd-server.yml
File metadata and controls
600 lines (516 loc) · 23.2 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
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
name: CD Server
run-name: "CD Server: ${{ github.ref_name }}"
on:
push:
branches: [main]
tags:
- 'server-v[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch: {}
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
permissions:
contents: read
jobs:
# Wait for CI to pass on this commit
wait-for-ci:
name: Wait for CI
runs-on: ubuntu-latest
permissions:
contents: read
checks: read
steps:
- name: Wait for CI checks to pass
uses: fountainhead/action-wait-for-check@v1.2.0
id: wait-for-ci
with:
token: ${{ secrets.GITHUB_TOKEN }}
checkName: CI Passed
ref: ${{ github.sha }}
timeoutSeconds: 900
intervalSeconds: 15
- name: Fail if CI did not pass
if: steps.wait-for-ci.outputs.conclusion != 'success'
run: |
echo "CI check 'CI Passed' did not pass (conclusion: ${{ steps.wait-for-ci.outputs.conclusion }})"
exit 1
build-server:
name: Build Server Binaries
needs: [wait-for-ci]
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
matrix:
include:
- os: ubuntu-latest
goos: linux
goarch: amd64
- os: ubuntu-latest
goos: linux
goarch: arm64
- os: windows-latest
goos: windows
goarch: amd64
- os: macos-latest
goos: darwin
goarch: amd64
- os: macos-latest
goos: darwin
goarch: arm64
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.25'
cache-dependency-path: |
common/go.sum
server/go.sum
- name: Get version
id: version
shell: bash
run: |
BASE_VERSION=$(cat server/VERSION)
GIT_COMMIT=$(git rev-parse --short HEAD)
BUILD_TIME=$(date -u +%Y-%m-%dT%H:%M:%SZ)
# Determine if this is a release (tag push) or dev build (main branch push)
if [[ "${{ github.ref }}" == refs/tags/server-v* ]]; then
echo "server_version=$BASE_VERSION" >> $GITHUB_OUTPUT
echo "build_type=release" >> $GITHUB_OUTPUT
else
echo "server_version=${BASE_VERSION}-dev.${GIT_COMMIT}" >> $GITHUB_OUTPUT
echo "build_type=dev" >> $GITHUB_OUTPUT
fi
echo "git_commit=$GIT_COMMIT" >> $GITHUB_OUTPUT
echo "build_time=$BUILD_TIME" >> $GITHUB_OUTPUT
- name: Build Server
working-directory: ./server
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0
run: |
go build -ldflags="-s -w -X 'main.Version=${{ steps.version.outputs.server_version }}' -X 'main.BuildTime=${{ steps.version.outputs.build_time }}' -X 'main.GitCommit=${{ steps.version.outputs.git_commit }}' -X 'main.BuildType=${{ steps.version.outputs.build_type }}'" -o printmaster-server-v${{ steps.version.outputs.server_version }}-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.goos == 'windows' && '.exe' || '' }} .
- name: Upload Server Binary
uses: actions/upload-artifact@v7
with:
name: server-${{ matrix.goos }}-${{ matrix.goarch }}
path: server/printmaster-server-v${{ steps.version.outputs.server_version }}-${{ matrix.goos }}-${{ matrix.goarch }}*
build-docker:
name: Build Docker (${{ matrix.platform }})
needs: [wait-for-ci]
runs-on: ${{ matrix.runner }}
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
include:
- platform: linux/amd64
runner: ubuntu-latest
suffix: amd64
- platform: linux/arm64
runner: ubuntu-24.04-arm
suffix: arm64
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get version
id: version
run: |
echo "version=$(cat server/VERSION)" >> $GITHUB_OUTPUT
echo "git_commit=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "build_time=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> $GITHUB_OUTPUT
# Dev builds from main branch, release builds from tags
if [[ "${{ github.ref }}" == refs/tags/server-v* ]]; then
echo "build_type=release" >> $GITHUB_OUTPUT
else
echo "build_type=dev" >> $GITHUB_OUTPUT
fi
- name: Build and push by digest
id: build
uses: docker/build-push-action@v5
with:
context: .
file: ./server/Dockerfile
platforms: ${{ matrix.platform }}
build-args: |
VERSION=${{ steps.version.outputs.version }}
BUILD_TIME=${{ steps.version.outputs.build_time }}
GIT_COMMIT=${{ steps.version.outputs.git_commit }}
BUILD_TYPE=${{ steps.version.outputs.build_type }}
cache-from: type=gha,scope=server-${{ matrix.suffix }}
cache-to: type=gha,mode=max,scope=server-${{ matrix.suffix }}
outputs: type=image,name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-server,push-by-digest=true,name-canonical=true,push=true
provenance: false
sbom: false
- name: Export digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v7
with:
name: server-digests-${{ matrix.suffix }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1
merge-docker:
name: Create Docker Manifest
needs: [build-docker]
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Download digests
uses: actions/download-artifact@v7
with:
path: /tmp/digests
pattern: server-digests-*
merge-multiple: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get version
id: version
run: |
echo "version=$(cat server/VERSION)" >> $GITHUB_OUTPUT
echo "git_commit=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
# Determine if this is a release (tag push) or dev build (main branch push)
if [[ "${{ github.ref }}" == refs/tags/server-v* ]]; then
echo "is_release=true" >> $GITHUB_OUTPUT
else
echo "is_release=false" >> $GITHUB_OUTPUT
fi
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-server
tags: |
type=semver,pattern={{version}},value=${{ steps.version.outputs.version }},enable=${{ steps.version.outputs.is_release }}
type=semver,pattern={{major}}.{{minor}},value=${{ steps.version.outputs.version }},enable=${{ steps.version.outputs.is_release }}
type=raw,value=latest,enable=${{ steps.version.outputs.is_release }}
type=raw,value=${{ steps.version.outputs.version }},enable=${{ steps.version.outputs.is_release }}
type=raw,value=main,enable=${{ github.ref == 'refs/heads/main' }}
type=raw,value=dev-${{ steps.version.outputs.git_commit }},enable=${{ github.ref == 'refs/heads/main' }}
labels: |
org.opencontainers.image.description=PrintMaster Server container image (build ${{ steps.version.outputs.version }} / commit ${{ steps.version.outputs.git_commit }})
- name: Create manifest list and push
working-directory: /tmp/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-server@sha256:%s ' *)
- name: Inspect image
run: |
if [[ "${{ github.ref }}" == refs/tags/server-v* ]]; then
docker buildx imagetools inspect ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-server:${{ steps.version.outputs.version }}
else
docker buildx imagetools inspect ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-server:main
fi
release-server:
name: Create Server Release
if: startsWith(github.ref, 'refs/tags/server-v')
needs: [build-server, merge-docker]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Download release artifacts
uses: actions/download-artifact@v7
with:
path: artifacts
pattern: server-*
merge-multiple: false
- name: Get version info
id: version
run: |
SERVER_VERSION=$(cat server/VERSION)
echo "version=$SERVER_VERSION" >> $GITHUB_OUTPUT
echo "tag=server-v$SERVER_VERSION" >> $GITHUB_OUTPUT
# Extract major.minor for compatible agent matching
MAJOR_MINOR=$(echo "$SERVER_VERSION" | sed 's/\.[^.]*$//')
# Find latest agent with matching minor version (e.g., server 0.9.5 -> agent 0.9.*)
MATCHING_AGENT_TAG=$(git tag -l "agent-v${MAJOR_MINOR}.*" --sort=-version:refname | head -n 1)
if [ -n "$MATCHING_AGENT_TAG" ]; then
echo "agent_version=${MATCHING_AGENT_TAG#agent-v}" >> $GITHUB_OUTPUT
echo "agent_tag=$MATCHING_AGENT_TAG" >> $GITHUB_OUTPUT
echo "Found compatible agent: $MATCHING_AGENT_TAG"
else
echo "agent_version=" >> $GITHUB_OUTPUT
echo "agent_tag=" >> $GITHUB_OUTPUT
echo "No compatible agent found for v${MAJOR_MINOR}.*"
fi
- name: Prepare release binaries
run: |
cd artifacts
for dir in */; do
name="${dir%/}"
binary=$(find "$dir" -maxdepth 1 -type f -name "printmaster-*" | head -n 1)
if [ -n "$binary" ]; then
cp "$binary" "./$(basename "$binary")"
echo "Prepared: $(basename "$binary")"
fi
done
echo "=== Release Binaries ==="
ls -lh printmaster-* 2>/dev/null || true
- name: Generate changelog
id: changelog
run: |
TAG_NAME="server-v${{ steps.version.outputs.version }}"
VERSION="${{ steps.version.outputs.version }}"
# Parse version components
MAJOR=$(echo "$VERSION" | cut -d. -f1)
MINOR=$(echo "$VERSION" | cut -d. -f2)
PATCH=$(echo "$VERSION" | cut -d. -f3)
# Determine release type and find appropriate comparison tag
if [ "$PATCH" = "0" ] && [ "$MINOR" = "0" ]; then
# Major release (x.0.0) - compare against last major
RELEASE_TYPE="major"
PREV_MAJOR=$((MAJOR - 1))
LAST_TAG=$(git tag -l "server-v${PREV_MAJOR}.*" --sort=-version:refname | head -n 1)
elif [ "$PATCH" = "0" ]; then
# Minor release (x.y.0) - compare against last minor's first tag
RELEASE_TYPE="minor"
PREV_MINOR=$((MINOR - 1))
LAST_TAG=$(git tag -l "server-v${MAJOR}.${PREV_MINOR}.*" --sort=-version:refname | head -n 1)
else
# Patch release - compare against previous patch
RELEASE_TYPE="patch"
LAST_TAG=$(git tag -l "server-v*" --sort=-version:refname | grep -v "^${TAG_NAME}$" | head -n 1)
fi
echo "Release type: $RELEASE_TYPE, comparing against: ${LAST_TAG:-none}"
if [ -z "$LAST_TAG" ]; then
CHANGELOG="Initial release"
else
# Get commits, filter release commits, and categorize
RAW_LOG=$(git log ${LAST_TAG}..${TAG_NAME} --pretty=format:"%s|||%h" --no-merges 2>/dev/null || echo "")
if [ -z "$RAW_LOG" ]; then
CHANGELOG="- Bug fixes and improvements"
else
# Categorize commits by conventional commit type
FEATURES=""
FIXES=""
DOCS=""
REFACTORS=""
OTHER=""
while IFS= read -r line; do
[ -z "$line" ] && continue
MSG=$(echo "$line" | cut -d'|' -f1)
HASH=$(echo "$line" | rev | cut -d'|' -f1 | rev)
# Skip release commits
echo "$MSG" | grep -q "^chore: Release" && continue
echo "$MSG" | grep -q "^chore(release)" && continue
# Categorize by type
if echo "$MSG" | grep -qE "^feat(\([^)]+\))?:"; then
DESC=$(echo "$MSG" | sed 's/^feat[^:]*: //')
FEATURES="${FEATURES}- ${DESC} (${HASH})\n"
elif echo "$MSG" | grep -qE "^fix(\([^)]+\))?:"; then
DESC=$(echo "$MSG" | sed 's/^fix[^:]*: //')
FIXES="${FIXES}- ${DESC} (${HASH})\n"
elif echo "$MSG" | grep -qE "^docs(\([^)]+\))?:"; then
DESC=$(echo "$MSG" | sed 's/^docs[^:]*: //')
DOCS="${DOCS}- ${DESC} (${HASH})\n"
elif echo "$MSG" | grep -qE "^refactor(\([^)]+\))?:"; then
DESC=$(echo "$MSG" | sed 's/^refactor[^:]*: //')
REFACTORS="${REFACTORS}- ${DESC} (${HASH})\n"
elif ! echo "$MSG" | grep -qE "^(chore|test|ci|build)(\([^)]+\))?:"; then
# Include non-chore/test/ci/build commits in OTHER
OTHER="${OTHER}- ${MSG} (${HASH})\n"
fi
done <<< "$RAW_LOG"
# Build changelog with sections
CHANGELOG=""
[ -n "$FEATURES" ] && CHANGELOG="${CHANGELOG}### ✨ Features\n${FEATURES}\n"
[ -n "$FIXES" ] && CHANGELOG="${CHANGELOG}### 🐛 Bug Fixes\n${FIXES}\n"
[ -n "$REFACTORS" ] && CHANGELOG="${CHANGELOG}### ♻️ Refactoring\n${REFACTORS}\n"
[ -n "$DOCS" ] && CHANGELOG="${CHANGELOG}### 📚 Documentation\n${DOCS}\n"
[ -n "$OTHER" ] && CHANGELOG="${CHANGELOG}### 📝 Other Changes\n${OTHER}\n"
# Fallback if nothing was categorized
if [ -z "$CHANGELOG" ]; then
CHANGELOG="- Bug fixes and improvements"
fi
fi
fi
# For major releases, add a note about checking full changelog
if [ "$RELEASE_TYPE" = "major" ]; then
CHANGELOG="**🎉 Major Release**\n\nThis is a major version update. Please review the [full changelog](https://github.com/mstrhakr/printmaster/compare/${LAST_TAG}...${TAG_NAME}) for breaking changes.\n\n${CHANGELOG}"
fi
{
echo 'CHANGELOG<<EOF'
echo -e "$CHANGELOG"
echo 'EOF'
} >> $GITHUB_OUTPUT
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.version.outputs.tag }}
name: PrintMaster Server v${{ steps.version.outputs.version }}
body: |
## PrintMaster Server v${{ steps.version.outputs.version }}
### 📝 Changes
${{ steps.changelog.outputs.CHANGELOG }}
---
### 📦 Installation
#### Docker (Recommended)
```bash
# Pull the latest image (supports amd64, arm64, arm/v7)
docker pull ghcr.io/mstrhakr/printmaster-server:${{ steps.version.outputs.version }}
docker pull ghcr.io/mstrhakr/printmaster-server:latest
# Run the container
docker run -d \
--name printmaster-server \
-p 9090:9090 \
-v printmaster-data:/var/lib/printmaster/server \
ghcr.io/mstrhakr/printmaster-server:latest
```
#### Binary Installation
1. Download the appropriate binary for your platform from the Assets section below
2. Extract the archive
3. Run the binary with `--help` to see available options
**Supported Platforms:**
- Windows (amd64)
- Linux (amd64, arm64)
- macOS (amd64, arm64)
---
### 🤖 Agent Downloads
You'll need the PrintMaster Agent to discover and monitor printers. Download the latest agent:
**Latest Agent: v${{ steps.version.outputs.agent_version }}** — [View Release](https://github.com/mstrhakr/printmaster/releases/tag/${{ steps.version.outputs.agent_tag }})
| Platform | Download |
|----------|----------|
| Windows (MSI) | [printmaster-agent-v${{ steps.version.outputs.agent_version }}-windows-amd64.msi](https://github.com/mstrhakr/printmaster/releases/download/${{ steps.version.outputs.agent_tag }}/printmaster-agent-v${{ steps.version.outputs.agent_version }}-windows-amd64.msi) |
| Linux (amd64) | [printmaster-agent-v${{ steps.version.outputs.agent_version }}-linux-amd64](https://github.com/mstrhakr/printmaster/releases/download/${{ steps.version.outputs.agent_tag }}/printmaster-agent-v${{ steps.version.outputs.agent_version }}-linux-amd64) |
| Linux (arm64) | [printmaster-agent-v${{ steps.version.outputs.agent_version }}-linux-arm64](https://github.com/mstrhakr/printmaster/releases/download/${{ steps.version.outputs.agent_tag }}/printmaster-agent-v${{ steps.version.outputs.agent_version }}-linux-arm64) |
| Debian/Ubuntu | [printmaster-agent_${{ steps.version.outputs.agent_version }}_amd64.deb](https://github.com/mstrhakr/printmaster/releases/download/${{ steps.version.outputs.agent_tag }}/printmaster-agent_${{ steps.version.outputs.agent_version }}_amd64.deb) |
| Fedora/RHEL | [printmaster-agent-${{ steps.version.outputs.agent_version }}.x86_64.rpm](https://github.com/mstrhakr/printmaster/releases/download/${{ steps.version.outputs.agent_tag }}/printmaster-agent-${{ steps.version.outputs.agent_version }}.x86_64.rpm) |
| macOS (Intel) | [printmaster-agent-v${{ steps.version.outputs.agent_version }}-darwin-amd64](https://github.com/mstrhakr/printmaster/releases/download/${{ steps.version.outputs.agent_tag }}/printmaster-agent-v${{ steps.version.outputs.agent_version }}-darwin-amd64) |
| macOS (Apple Silicon) | [printmaster-agent-v${{ steps.version.outputs.agent_version }}-darwin-arm64](https://github.com/mstrhakr/printmaster/releases/download/${{ steps.version.outputs.agent_tag }}/printmaster-agent-v${{ steps.version.outputs.agent_version }}-darwin-arm64) |
---
### ⏱️ Build Information
- **Workflow run:** ${{ github.run_id }}
- **Commit:** ${{ github.sha }}
### 🔗 Links
- [Documentation](https://github.com/mstrhakr/printmaster/tree/main/docs)
- [Docker Images](https://github.com/mstrhakr/printmaster/pkgs/container/printmaster-server)
- [Issue Tracker](https://github.com/mstrhakr/printmaster/issues)
files: artifacts/printmaster-*
fail_on_unmatched_files: false
draft: false
prerelease: false
release-server-dev:
name: Create Server Dev Release
if: github.ref == 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/')
needs: [build-server, merge-docker]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Download release artifacts
uses: actions/download-artifact@v7
with:
path: artifacts
pattern: server-*
merge-multiple: false
- name: Get version info
id: version
run: |
BASE_VERSION=$(cat server/VERSION)
GIT_COMMIT=$(git rev-parse --short HEAD)
DEV_VERSION="${BASE_VERSION}-dev.${GIT_COMMIT}"
echo "version=$DEV_VERSION" >> $GITHUB_OUTPUT
echo "tag=server-v$DEV_VERSION" >> $GITHUB_OUTPUT
echo "base_version=$BASE_VERSION" >> $GITHUB_OUTPUT
echo "git_commit=$GIT_COMMIT" >> $GITHUB_OUTPUT
- name: Prepare release binaries
run: |
cd artifacts
for dir in */; do
name="${dir%/}"
binary=$(find "$dir" -maxdepth 1 -type f -name "printmaster-*" | head -n 1)
if [ -n "$binary" ]; then
cp "$binary" "./$(basename "$binary")"
echo "Prepared: $(basename "$binary")"
fi
done
echo "=== Release Binaries ==="
ls -lh printmaster-* 2>/dev/null || true
- name: Delete existing dev release (if any)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Delete the existing dev tag/release if it exists (we always update the dev release)
TAG="server-v${{ steps.version.outputs.version }}"
if gh release view "$TAG" &>/dev/null; then
echo "Deleting existing release $TAG..."
gh release delete "$TAG" --yes || true
fi
if git ls-remote --tags origin | grep -q "refs/tags/$TAG"; then
echo "Deleting existing tag $TAG..."
git push origin --delete "$TAG" || true
fi
- name: Create GitHub Dev Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.version.outputs.tag }}
name: PrintMaster Server v${{ steps.version.outputs.version }} (Dev)
body: |
## PrintMaster Server v${{ steps.version.outputs.version }} (Development Build)
⚠️ **This is a development build from the main branch.** It may contain unstable or experimental features.
To receive dev builds automatically, set your server's `releases.include_prerelease = "true"` or run a dev build of the server.
---
### 📦 Installation
#### Docker
```bash
# Pull the dev image
docker pull ghcr.io/mstrhakr/printmaster-server:main
# Run the container
docker run -d \
--name printmaster-server \
-p 9090:9090 \
-v printmaster-data:/var/lib/printmaster/server \
ghcr.io/mstrhakr/printmaster-server:main
```
---
### ⏱️ Build Information
- **Base Version:** ${{ steps.version.outputs.base_version }}
- **Commit:** ${{ steps.version.outputs.git_commit }}
- **Full SHA:** ${{ github.sha }}
- **Workflow run:** ${{ github.run_id }}
### 🔗 Links
- [Documentation](https://github.com/mstrhakr/printmaster/tree/main/docs)
- [Docker Images](https://github.com/mstrhakr/printmaster/pkgs/container/printmaster-server)
- [Issue Tracker](https://github.com/mstrhakr/printmaster/issues)
files: artifacts/printmaster-*
fail_on_unmatched_files: false
draft: false
prerelease: true