Skip to content

Commit b60c5d6

Browse files
committed
Fix AUR deploy
1 parent 170f3c5 commit b60c5d6

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,14 +222,17 @@ jobs:
222222
- name: Generate PKGBUILDs
223223
shell: bash
224224
run: |
225-
pip install requests
225+
# requests is already installed
226+
# pip install requests
226227
python ci/build_pkgbuild.py ${{env.TAG}}
228+
cat ./ci/cotp/PKGBUILD
229+
cat ./ci/cotp-bin/PKGBUILD
227230
228231
- name: Publish cotp AUR package
229232
uses: KSXGitHub/[email protected]
230233
with:
231234
pkgname: cotp
232-
pkgbuild: ./PKGBUILD-cotp
235+
pkgbuild: ./ci/cotp/PKGBUILD
233236
commit_username: ${{ secrets.AUR_USERNAME }}
234237
commit_email: ${{ secrets.AUR_EMAIL }}
235238
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
@@ -240,7 +243,7 @@ jobs:
240243
uses: KSXGitHub/[email protected]
241244
with:
242245
pkgname: cotp-bin
243-
pkgbuild: ./PKGBUILD-cotp-bin
246+
pkgbuild: ./ci/cotp-bin/PKGBUILD
244247
commit_username: ${{ secrets.AUR_USERNAME }}
245248
commit_email: ${{ secrets.AUR_EMAIL }}
246249
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}

ci/build_pkgbuild.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
COTP_PKGBUILD_TEMPLATE_PATH = "ci/templates/PKGBUILD.cotp.template"
99
COTP_BIN_PKGBUILD_TEMPLATE_PATH = "ci/templates/PKGBUILD.cotp-bin.template"
1010

11+
COTP_PKGBUILD_PATH = "ci/templates/cotp/PKGBUILD"
12+
COTP_BIN_PKGBUILD_PATH = "ci/templates/cotp-bin/PKGBUILD"
13+
1114

1215
def eprint(*args, **kwargs):
1316
print(*args, file=sys.stderr, **kwargs)
@@ -51,21 +54,26 @@ def main():
5154
return
5255

5356
version = match.group(1)
57+
print(f"Version detected: {version}")
58+
Path("ci/cotp").mkdir(exist_ok=True)
59+
Path("ci/cotp-bin").mkdir(exist_ok=True)
5460

5561
source_url = f"https://github.com/replydev/cotp/archive/v{version}.tar.gz"
5662
source_filename = f"{version}.tar.gz"
5763
download_file(source_url, source_filename)
5864
source_digest = file_digest(source_filename)
65+
print(f"Source digest: {source_digest}")
5966

6067
compiled_bin_url = f"https://github.com/replydev/cotp/releases/download/v{version}/cotp-v{version}-x86_64-linux.tar.xz"
6168
compiled_bin_filename = f"cotp-v{version}-x86_64-linux.tar.xz"
6269
download_file(compiled_bin_url, compiled_bin_filename)
6370
compiled_bin_digest = file_digest(compiled_bin_filename)
71+
print(f"Binary digest: {compiled_bin_digest}")
6472

65-
replace(COTP_PKGBUILD_TEMPLATE_PATH, "PKGBUILD-cotp", version, source_digest)
73+
replace(COTP_PKGBUILD_TEMPLATE_PATH, COTP_PKGBUILD_PATH, version, source_digest)
6674
replace(
6775
COTP_BIN_PKGBUILD_TEMPLATE_PATH,
68-
"PKGBUILD-cotp-bin",
76+
COTP_BIN_PKGBUILD_PATH,
6977
version,
7078
compiled_bin_digest,
7179
)

0 commit comments

Comments
 (0)