-
-
Notifications
You must be signed in to change notification settings - Fork 9
91 lines (76 loc) · 2.96 KB
/
release-fedora.yml
File metadata and controls
91 lines (76 loc) · 2.96 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
name: Release Fedora
on:
push:
tags:
- 'v*'
jobs:
build-srpm:
runs-on: ubuntu-latest
container:
image: fedora:43
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: |
dnf install -y golang rpm-build rpmlint curl copr-cli glibc-langpack-en
- name: Vendor Go dependencies
run: go mod vendor
- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
- name: Update spec version
run: |
sed -i "s/^%global app_version.*/%global app_version ${{ steps.version.outputs.VERSION }}/" \
packaging/fedora/speak-to-ai.spec
- name: Lint spec file
run: rpmlint -r packaging/fedora/.rpmlintrc packaging/fedora/speak-to-ai.spec
- name: Create SRPM
run: |
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
# Copy spec
cp packaging/fedora/speak-to-ai.spec ~/rpmbuild/SPECS/
# Create vendored tarball
VERSION="${{ steps.version.outputs.VERSION }}"
tar --transform "s,^,speak-to-ai-${VERSION}/," \
--exclude='.git' \
--exclude='build' \
--exclude='dist' \
--exclude='lib' \
-czf ~/rpmbuild/SOURCES/speak-to-ai-${VERSION}-vendored.tar.gz \
cmd/ config/ hotkeys/ audio/ whisper/ output/ websocket/ internal/ \
vendor/ \
go.mod go.sum \
Makefile LICENSE README.md CHANGELOG.md \
config.yaml \
io.github.ashbuk.speak-to-ai.desktop \
io.github.ashbuk.speak-to-ai.appdata.xml \
icons/ docs/ packaging/
# Download whisper.cpp
WHISPER_VERSION=$(grep -E '^%global whisper_version' packaging/fedora/speak-to-ai.spec | awk '{print $3}')
curl -L -o ~/rpmbuild/SOURCES/whisper-cpp-${WHISPER_VERSION}.tar.gz \
"https://github.com/ggml-org/whisper.cpp/archive/refs/tags/v${WHISPER_VERSION}.tar.gz"
# Build SRPM
rpmbuild -bs ~/rpmbuild/SPECS/speak-to-ai.spec
- name: Upload SRPM artifact
uses: actions/upload-artifact@v4
with:
name: srpm
path: ~/rpmbuild/SRPMS/*.src.rpm
- name: Submit to COPR
env:
COPR_API_TOKEN: ${{ secrets.COPR_API_TOKEN }}
run: |
# Configure copr-cli
mkdir -p ~/.config
cat > ~/.config/copr <<EOF
[copr-cli]
copr_url = https://copr.fedorainfracloud.org
login = ${{ secrets.COPR_LOGIN }}
username = ${{ secrets.COPR_USERNAME }}
token = ${COPR_API_TOKEN}
EOF
chmod 600 ~/.config/copr
# Submit build
SRPM=~/rpmbuild/SRPMS/speak-to-ai-${{ steps.version.outputs.VERSION }}-1.fc43.src.rpm
copr-cli build speak-to-ai "$SRPM"