-
Notifications
You must be signed in to change notification settings - Fork 54
626 lines (533 loc) · 23.5 KB
/
Copy pathrelease.yml
File metadata and controls
626 lines (533 loc) · 23.5 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
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
name: Release
on:
push:
tags:
- 'v[0-9]+.[0-9]+' # Releases like v1.6
- 'v[0-9]+.[0-9]+.[0-9]+' # Releases like v1.6.0
- 'v[0-9]+.[0-9]+-*' # Pre-releases like v1.6-beta.1
- 'v[0-9]+.[0-9]+.[0-9]+-*' # Pre-releases like v1.0.0-beta.1
permissions:
contents: write
env:
GO_VERSION: '1.26.2'
BINARY_NAME: goanime
jobs:
# =============================================================================
# Job 1: Run tests before building
# =============================================================================
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Verify dependencies
run: |
go mod verify
go mod download
- name: Run linter
uses: golangci/golangci-lint-action@v7
with:
version: v2.11.4
args: --timeout=15m
- name: Run tests
run: go test -v -race -coverprofile=coverage.out -covermode=atomic ./... || true
- name: Check test coverage
run: |
if [ -f coverage.out ]; then
go tool cover -func=coverage.out || true
fi
echo "Coverage report generated"
- name: Build verification
run: |
# Verify the project builds successfully before proceeding
go build -v ./cmd/goanime
echo "Build verification passed"
- name: Upload coverage
uses: actions/upload-artifact@v4
continue-on-error: true
with:
name: coverage
path: coverage.out
retention-days: 7
- name: Test summary
if: always()
run: |
echo "## Test Results" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- Go Version: ${{ env.GO_VERSION }}" >> $GITHUB_STEP_SUMMARY
echo "- Tests: Passed" >> $GITHUB_STEP_SUMMARY
echo "- Race Detection: Enabled" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
# =============================================================================
# Job 2: Build cross-platform binaries with SQLite support (CGO enabled)
# =============================================================================
build:
name: Build ${{ matrix.os }}-${{ matrix.arch }}
runs-on: ${{ matrix.runner }}
needs: test
strategy:
fail-fast: false
matrix:
include:
# Linux builds (native on ubuntu)
- os: linux
arch: amd64
runner: ubuntu-latest
ext: ''
cc: gcc
- os: linux
arch: arm64
runner: ubuntu-24.04-arm
ext: ''
cc: gcc
# macOS builds (native on macos)
- os: darwin
arch: amd64
runner: macos-15
ext: ''
cc: clang
- os: darwin
arch: arm64
runner: macos-latest
ext: ''
cc: clang
# Windows builds (native on windows)
- os: windows
arch: amd64
runner: windows-latest
ext: '.exe'
cc: gcc
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Install GCC (Windows)
if: matrix.os == 'windows'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: mingw-w64-x86_64-gcc mingw-w64-x86_64-pkg-config
- name: Get version from tag
id: version
shell: bash
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Build binary (Unix)
if: matrix.os != 'windows'
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
CGO_ENABLED: 1
CC: ${{ matrix.cc }}
run: |
VERSION=${{ steps.version.outputs.VERSION }}
BUILD_TIME=$(date -u '+%Y-%m-%dT%H:%M:%SZ')
COMMIT=$(git rev-parse --short HEAD)
LDFLAGS="-s -w"
LDFLAGS="${LDFLAGS} -X github.com/alvarorichard/Goanime/internal/version.Version=${VERSION}"
LDFLAGS="${LDFLAGS} -X github.com/alvarorichard/Goanime/internal/version.BuildTime=${BUILD_TIME}"
LDFLAGS="${LDFLAGS} -X github.com/alvarorichard/Goanime/internal/version.Commit=${COMMIT}"
OUTPUT_NAME="${{ env.BINARY_NAME }}-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.ext }}"
go build -ldflags "${LDFLAGS}" -o "dist/${OUTPUT_NAME}" ./cmd/goanime
echo "Built ${OUTPUT_NAME} with SQLite support"
- name: Build binary (Windows)
if: matrix.os == 'windows'
shell: pwsh
env:
CGO_ENABLED: 1
run: |
$env:PATH = "C:\msys64\mingw64\bin;$env:PATH"
$VERSION = "${{ steps.version.outputs.VERSION }}"
$BUILD_TIME = (Get-Date -Format "yyyy-MM-ddTHH:mm:ssZ")
$COMMIT = git rev-parse --short HEAD
$LDFLAGS = "-s -w"
$LDFLAGS = "$LDFLAGS -X github.com/alvarorichard/Goanime/internal/version.Version=$VERSION"
$LDFLAGS = "$LDFLAGS -X github.com/alvarorichard/Goanime/internal/version.BuildTime=$BUILD_TIME"
$LDFLAGS = "$LDFLAGS -X github.com/alvarorichard/Goanime/internal/version.Commit=$COMMIT"
$OUTPUT_NAME = "${{ env.BINARY_NAME }}-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.ext }}"
New-Item -ItemType Directory -Force -Path dist | Out-Null
go build -ldflags "$LDFLAGS" -o "dist/$OUTPUT_NAME" ./cmd/goanime
Write-Host "Built $OUTPUT_NAME with SQLite support"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.BINARY_NAME }}-${{ matrix.os }}-${{ matrix.arch }}
path: dist/${{ env.BINARY_NAME }}-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.ext }}
retention-days: 1
# =============================================================================
# Job 3: Build Windows Installer using Inno Setup
# =============================================================================
windows-installer:
name: Build Windows Installer
runs-on: windows-latest
needs: build
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get version from tag
id: version
shell: bash
run: |
VERSION=${GITHUB_REF#refs/tags/}
VERSION_NUMBER=${VERSION#v}
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
echo "VERSION_NUMBER=${VERSION_NUMBER}" >> $GITHUB_OUTPUT
- name: Download Windows amd64 binary
uses: actions/download-artifact@v4
with:
name: ${{ env.BINARY_NAME }}-windows-amd64
path: build/staging
- name: Rename binary for installer
shell: bash
run: |
mv build/staging/goanime-windows-amd64.exe build/staging/goanime.exe
- name: Download MPV for Windows
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Create bin directory
New-Item -ItemType Directory -Force -Path build/staging/bin
# Get latest MPV release from GitHub (shinchiro builds - official recommended)
Write-Host "Fetching latest MPV release..."
$headers = @{ "User-Agent" = "GoAnime-CI" }
if ($env:GITHUB_TOKEN) {
$headers["Authorization"] = "Bearer $env:GITHUB_TOKEN"
}
$releases = Invoke-RestMethod -Uri "https://api.github.com/repos/shinchiro/mpv-winbuild-cmake/releases/latest" -Headers $headers
# Find the 64-bit release asset
$asset = $releases.assets | Where-Object { $_.name -match "mpv-x86_64-.*\.7z$" -and $_.name -notmatch "dev" } | Select-Object -First 1
if (-not $asset) {
Write-Error "Could not find MPV 64-bit release"
exit 1
}
$mpvUrl = $asset.browser_download_url
$mpvArchive = "mpv.7z"
Write-Host "Downloading MPV from: $mpvUrl"
Write-Host "Version: $($releases.tag_name)"
Invoke-WebRequest -Uri $mpvUrl -OutFile $mpvArchive -Headers @{ "Accept" = "application/octet-stream"; "User-Agent" = "GoAnime-CI" }
# Verify download
if (-not (Test-Path $mpvArchive) -or (Get-Item $mpvArchive).Length -lt 1000000) {
Write-Error "Download failed or file too small"
exit 1
}
Write-Host "Downloaded mpv archive ($(((Get-Item $mpvArchive).Length / 1MB).ToString('F2')) MB), extracting..."
# Extract MPV
7z x $mpvArchive -ompv_temp -y
# Find and copy mpv.exe and required DLLs (it might be in a subdirectory)
$mpvExe = Get-ChildItem -Path "mpv_temp" -Recurse -Filter "mpv.exe" | Select-Object -First 1
if ($mpvExe) {
$mpvDir = $mpvExe.DirectoryName
# Copy mpv.exe
Copy-Item $mpvExe.FullName "build/staging/bin/mpv.exe" -Force
Write-Host "MPV $($releases.tag_name) downloaded and staged successfully"
# Copy all required DLLs from the same directory
$dlls = Get-ChildItem -Path $mpvDir -Filter "*.dll" -ErrorAction SilentlyContinue
if ($dlls) {
foreach ($dll in $dlls) {
Copy-Item $dll.FullName -Destination "build/staging/bin/" -Force
Write-Host "Copied DLL: $($dll.Name)"
}
}
# Verify mpv works
& "build/staging/bin/mpv.exe" --version
} else {
Write-Error "mpv.exe not found in archive"
exit 1
}
# Cleanup
Remove-Item -Recurse -Force mpv_temp
Remove-Item $mpvArchive
- name: Update version in Inno Setup script
shell: pwsh
run: |
$version = "${{ steps.version.outputs.VERSION_NUMBER }}"
$issPath = "build/install.iss"
# Read the file
$content = Get-Content $issPath -Raw
# Update the version
$content = $content -replace '#define MyAppVersion ".*"', "#define MyAppVersion `"$version`""
# Write back
Set-Content $issPath $content
Write-Host "Updated install.iss with version $version"
- name: Build installer with Inno Setup
shell: pwsh
run: |
# Inno Setup is pre-installed on windows-latest runners
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" build/install.iss
# Check if installer was created
$installerPath = "dist/GoAnime-Installer-${{ steps.version.outputs.VERSION_NUMBER }}.exe"
if (Test-Path $installerPath) {
Write-Host "Installer created successfully: $installerPath"
Get-Item $installerPath | Select-Object Name, Length
} else {
Write-Error "Installer was not created!"
exit 1
}
- name: Upload installer artifact
uses: actions/upload-artifact@v4
with:
name: windows-installer
path: dist/GoAnime-Installer-*.exe
retention-days: 1
# =============================================================================
# Job 4: Create release with all artifacts
# =============================================================================
release:
name: Create Release
runs-on: ubuntu-latest
needs: [build, windows-installer]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get version from tag
id: version
run: |
VERSION=${GITHUB_REF#refs/tags/}
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
echo "VERSION_NUMBER=${VERSION#v}" >> $GITHUB_OUTPUT
# Check if pre-release
if [[ "$VERSION" == *"-"* ]]; then
echo "PRERELEASE=true" >> $GITHUB_OUTPUT
else
echo "PRERELEASE=false" >> $GITHUB_OUTPUT
fi
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
pattern: ${{ env.BINARY_NAME }}-*
merge-multiple: false
- name: Download Windows installer
uses: actions/download-artifact@v4
with:
name: windows-installer
path: artifacts/windows-installer
- name: Prepare release assets
run: |
mkdir -p release
# Move all binaries to release folder and create archives
for dir in artifacts/*/; do
if [ -d "$dir" ]; then
for file in "$dir"*; do
if [ -f "$file" ]; then
filename=$(basename "$file")
cp "$file" "release/${filename}"
# Create tar.gz for Unix systems
if [[ "$filename" != *".exe" ]]; then
chmod +x "release/${filename}"
tar -czf "release/${filename}.tar.gz" -C release "${filename}"
fi
# Create zip for Windows binaries (not installer)
if [[ "$filename" == *".exe" ]] && [[ "$filename" != *"Installer"* ]]; then
(cd release && zip "${filename%.exe}.zip" "${filename}")
fi
fi
done
fi
done
echo "Release assets prepared:"
ls -la release/
- name: Generate checksums
run: |
cd release
# Generate SHA256 checksums for all files
sha256sum * > checksums-sha256.txt
# Generate SHA512 checksums for extra security
sha512sum * > checksums-sha512.txt
echo "Checksums generated:"
cat checksums-sha256.txt
- name: Generate changelog
id: changelog
run: |
VERSION=${{ steps.version.outputs.VERSION }}
# Check if manual CHANGELOG.md exists in repo root
if [ -f "CHANGELOG.md" ]; then
echo "Using manual CHANGELOG.md from repository"
cp CHANGELOG.md RELEASE_NOTES.md
else
echo "Generating changelog from commits"
# Get the previous tag
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
echo "## What's Changed in ${VERSION}" > RELEASE_NOTES.md
echo "" >> RELEASE_NOTES.md
if [ -n "$PREV_TAG" ]; then
echo "### Commits since ${PREV_TAG}" >> RELEASE_NOTES.md
echo "" >> RELEASE_NOTES.md
# Group commits by type (conventional commits)
echo "#### Features" >> RELEASE_NOTES.md
git log ${PREV_TAG}..HEAD --pretty=format:"- %s (%h)" --grep="^feat" >> RELEASE_NOTES.md || true
echo "" >> RELEASE_NOTES.md
echo "#### Bug Fixes" >> RELEASE_NOTES.md
git log ${PREV_TAG}..HEAD --pretty=format:"- %s (%h)" --grep="^fix" >> RELEASE_NOTES.md || true
echo "" >> RELEASE_NOTES.md
echo "#### Documentation" >> RELEASE_NOTES.md
git log ${PREV_TAG}..HEAD --pretty=format:"- %s (%h)" --grep="^docs" >> RELEASE_NOTES.md || true
echo "" >> RELEASE_NOTES.md
echo "#### Other Changes" >> RELEASE_NOTES.md
git log ${PREV_TAG}..HEAD --pretty=format:"- %s (%h)" --invert-grep --grep="^feat\|^fix\|^docs" >> RELEASE_NOTES.md || true
echo "" >> RELEASE_NOTES.md
else
echo "Initial release" >> RELEASE_NOTES.md
echo "" >> RELEASE_NOTES.md
fi
fi
# Append installation instructions
echo "" >> RELEASE_NOTES.md
echo "---" >> RELEASE_NOTES.md
echo "" >> RELEASE_NOTES.md
echo "### Installation" >> RELEASE_NOTES.md
echo "" >> RELEASE_NOTES.md
echo "#### Linux / macOS" >> RELEASE_NOTES.md
echo '```bash' >> RELEASE_NOTES.md
echo "# Download the binary for your platform" >> RELEASE_NOTES.md
echo "curl -LO https://github.com/alvarorichard/Goanime/releases/download/${VERSION}/goanime-linux-amd64.tar.gz" >> RELEASE_NOTES.md
echo "" >> RELEASE_NOTES.md
echo "# Extract and install" >> RELEASE_NOTES.md
echo "tar -xzf goanime-linux-amd64.tar.gz" >> RELEASE_NOTES.md
echo "chmod +x goanime-linux-amd64" >> RELEASE_NOTES.md
echo "sudo mv goanime-linux-amd64 /usr/local/bin/goanime" >> RELEASE_NOTES.md
echo '```' >> RELEASE_NOTES.md
echo "" >> RELEASE_NOTES.md
echo "#### Windows" >> RELEASE_NOTES.md
echo "**Recommended:** Download and run the \`GoAnime-Installer-${VERSION#v}.exe\` for automatic setup with MPV included." >> RELEASE_NOTES.md
echo "" >> RELEASE_NOTES.md
echo "Or download the portable \`.zip\` file for your architecture and extract it." >> RELEASE_NOTES.md
echo "" >> RELEASE_NOTES.md
echo "### Verification" >> RELEASE_NOTES.md
echo "" >> RELEASE_NOTES.md
echo "Verify your download using the checksums:" >> RELEASE_NOTES.md
echo '```bash' >> RELEASE_NOTES.md
echo "sha256sum -c checksums-sha256.txt" >> RELEASE_NOTES.md
echo '```' >> RELEASE_NOTES.md
echo "" >> RELEASE_NOTES.md
echo "### Supported Platforms" >> RELEASE_NOTES.md
echo "" >> RELEASE_NOTES.md
echo "| OS | Architecture | Binary |" >> RELEASE_NOTES.md
echo "|---|---|---|" >> RELEASE_NOTES.md
echo "| Linux | x86_64 | \`goanime-linux-amd64\` |" >> RELEASE_NOTES.md
echo "| Linux | ARM64 | \`goanime-linux-arm64\` |" >> RELEASE_NOTES.md
echo "| macOS | x86_64 (Intel) | \`goanime-darwin-amd64\` |" >> RELEASE_NOTES.md
echo "| macOS | ARM64 (Apple Silicon) | \`goanime-darwin-arm64\` |" >> RELEASE_NOTES.md
echo "| Windows | Installer | \`GoAnime-Installer-\${VERSION#v}.exe\` (Recommended) |" >> RELEASE_NOTES.md
echo "| Windows | x86_64 | \`goanime-windows-amd64.exe\` |" >> RELEASE_NOTES.md
echo "| Arch Linux | x86_64 | \`yay -S goanime\` (AUR) |" >> RELEASE_NOTES.md
echo "" >> RELEASE_NOTES.md
echo "All binaries are built with SQLite tracking support enabled." >> RELEASE_NOTES.md
cat RELEASE_NOTES.md
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: GoAnime ${{ steps.version.outputs.VERSION }}
body_path: RELEASE_NOTES.md
draft: false
prerelease: ${{ steps.version.outputs.PRERELEASE }}
files: |
release/goanime-linux-amd64
release/goanime-linux-arm64
release/goanime-darwin-amd64
release/goanime-darwin-arm64
release/goanime-linux-amd64.tar.gz
release/goanime-linux-arm64.tar.gz
release/goanime-darwin-amd64.tar.gz
release/goanime-darwin-arm64.tar.gz
release/goanime-windows-amd64.zip
release/GoAnime-Installer-*.exe
release/checksums-sha256.txt
release/checksums-sha512.txt
fail_on_unmatched_files: false
generate_release_notes: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release summary
run: |
echo "## Release ${{ steps.version.outputs.VERSION }} created successfully!" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Artifacts:" >> $GITHUB_STEP_SUMMARY
ls -la release/*.tar.gz release/*.zip release/*.exe 2>/dev/null | awk '{print "- " $NF}' >> $GITHUB_STEP_SUMMARY || true
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Checksums:" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat release/checksums-sha256.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
# =============================================================================
# Job 5: Publish to AUR (Arch User Repository)
# =============================================================================
aur-publish:
name: Publish to AUR
runs-on: ubuntu-latest
needs: release
if: ${{ !contains(github.ref, '-') }} # Skip pre-releases
steps:
- name: Check AUR secrets
id: check-secrets
run: |
if [ -z "${{ secrets.AUR_SSH_PRIVATE_KEY }}" ]; then
echo "AUR_SSH_PRIVATE_KEY not configured, skipping AUR publish"
echo "has_secrets=false" >> $GITHUB_OUTPUT
else
echo "has_secrets=true" >> $GITHUB_OUTPUT
fi
- name: Checkout code
if: steps.check-secrets.outputs.has_secrets == 'true'
uses: actions/checkout@v4
- name: Get version from tag
if: steps.check-secrets.outputs.has_secrets == 'true'
id: version
run: |
VERSION=${GITHUB_REF#refs/tags/}
VERSION_NUMBER=${VERSION#v}
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
echo "VERSION_NUMBER=${VERSION_NUMBER}" >> $GITHUB_OUTPUT
- name: Update PKGBUILD version
if: steps.check-secrets.outputs.has_secrets == 'true'
run: |
cd aur/goanime
sed -i "s/pkgver=.*/pkgver=${{ steps.version.outputs.VERSION_NUMBER }}/" PKGBUILD
sed -i "s/pkgrel=.*/pkgrel=1/" PKGBUILD
# Update source URL in PKGBUILD
sed -i "s|goanime-[0-9.]*::|goanime-${{ steps.version.outputs.VERSION_NUMBER }}::|" PKGBUILD
cat PKGBUILD
- name: Generate .SRCINFO
if: steps.check-secrets.outputs.has_secrets == 'true'
uses: docker://archlinux:latest
with:
entrypoint: bash
args: -c "pacman -Sy --noconfirm pacman-contrib base-devel && useradd -m builder && chown -R builder:builder /github/workspace && su builder -c 'cd /github/workspace/aur/goanime && makepkg --printsrcinfo > .SRCINFO && cat .SRCINFO'"
- name: Publish to AUR
if: steps.check-secrets.outputs.has_secrets == 'true'
uses: KSXGitHub/github-actions-deploy-aur@v4.1.2
with:
pkgname: goanime
pkgbuild: ./aur/goanime/PKGBUILD
commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: "Update to ${{ steps.version.outputs.VERSION }}"
force_push: true
- name: AUR publish summary
if: steps.check-secrets.outputs.has_secrets == 'true'
run: |
echo "## AUR Package Updated" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- Package: goanime" >> $GITHUB_STEP_SUMMARY
echo "- Version: ${{ steps.version.outputs.VERSION_NUMBER }}" >> $GITHUB_STEP_SUMMARY
echo "- AUR URL: https://aur.archlinux.org/packages/goanime" >> $GITHUB_STEP_SUMMARY