-
-
Notifications
You must be signed in to change notification settings - Fork 9
91 lines (75 loc) · 2.99 KB
/
release-arch.yml
File metadata and controls
91 lines (75 loc) · 2.99 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
# Copyright (c) 2025 Asher Buk
# SPDX-License-Identifier: MIT
name: Release Arch
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+' # Only stable tags (v1.0.0), not RC (v1.0.0-rc.1)
jobs:
aur-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
- name: Generate checksums
id: checksums
run: |
VERSION="${{ steps.version.outputs.VERSION }}"
WHISPER_VERSION=$(grep -E '^_whisper_version=' packaging/arch/PKGBUILD | cut -d= -f2)
# Download and checksum main source
curl -sL -o source.tar.gz \
"https://github.com/AshBuk/speak-to-ai/archive/refs/tags/v${VERSION}.tar.gz"
MAIN_SHA256=$(sha256sum source.tar.gz | cut -d' ' -f1)
# Download and checksum whisper.cpp
curl -sL -o whisper.tar.gz \
"https://github.com/ggml-org/whisper.cpp/archive/refs/tags/v${WHISPER_VERSION}.tar.gz"
WHISPER_SHA256=$(sha256sum whisper.tar.gz | cut -d' ' -f1)
echo "MAIN_SHA256=${MAIN_SHA256}" >> $GITHUB_OUTPUT
echo "WHISPER_SHA256=${WHISPER_SHA256}" >> $GITHUB_OUTPUT
rm -f source.tar.gz whisper.tar.gz
- name: Update PKGBUILD version and checksums
run: |
VERSION="${{ steps.version.outputs.VERSION }}"
MAIN_SHA256="${{ steps.checksums.outputs.MAIN_SHA256 }}"
WHISPER_SHA256="${{ steps.checksums.outputs.WHISPER_SHA256 }}"
cd packaging/arch
# Update version
sed -i "s/^pkgver=.*/pkgver=${VERSION}/" PKGBUILD
sed -i "s/^pkgrel=.*/pkgrel=1/" PKGBUILD
# Update checksums
sed -i "s/'SKIP' # TODO: Update on release/'${MAIN_SHA256}'/" PKGBUILD
sed -i "s/'SKIP' # whisper.cpp checksum/'${WHISPER_SHA256}'/" PKGBUILD
- name: Generate .SRCINFO
uses: docker://archlinux:latest
with:
entrypoint: /bin/bash
args: |
-c "
pacman -Syu --noconfirm pacman-contrib
useradd -m builder
chown -R builder:builder packaging/arch
cd packaging/arch
su builder -c 'makepkg --printsrcinfo > .SRCINFO'
"
- name: Lint PKGBUILD
uses: docker://archlinux:latest
with:
entrypoint: /bin/bash
args: |
-c "
pacman -Syu --noconfirm namcap
namcap packaging/arch/PKGBUILD
"
- name: Publish to AUR
uses: KSXGitHub/github-actions-deploy-aur@v3.0.1
with:
pkgname: speak-to-ai
pkgbuild: packaging/arch/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: false