File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5555 name : rpm
5656 path : pkg/rpmbuild/RPMS/**/*.rpm
5757 retention-days : 1
58+
59+ # we use a ubuntu image here even just for the arch build because when we
60+ # bump the minimum to noble we can unify these two steps (makepkg/packman
61+ # are not in the jammy image but they are in the noble image)
62+ arch :
63+ runs-on : ubuntu-latest
64+ container :
65+ image : ubuntu:noble
66+ # needs: [main]
67+ steps :
68+ - run : apt-get update
69+ - run : apt-get upgrade -y
70+ - run : |
71+ apt-get install -y \
72+ ca-certificates \
73+ build-essential \
74+ file \
75+ gcc-aarch64-linux-gnu \
76+ libarchive-tools \
77+ makepkg \
78+ pacman-package-manager \
79+ rclone \
80+ tree \
81+ unzip
82+ - uses : crazy-max/ghaction-import-gpg@v7
83+ with :
84+ gpg_private_key : ${{ secrets.GPG_PRIVATE_KEY }}
85+ passphrase : ${{ secrets.GPG_PASSPHRASE }}
86+ - uses : actions/checkout@v6
87+ - uses : actions/setup-go@v6
88+ with :
89+ cache : true
90+ go-version-file : go.mod
91+ - uses : sqlc-dev/setup-sqlc@v4
92+ with :
93+ sqlc-version : 1.30.0
94+ - run : sqlc generate
95+ - run : go install github.com/google/go-licenses/v2@latest
96+ - run : useradd -m builder
97+ - run : ./pkg/buildarch.bash
98+ - uses : actions/upload-artifact@v6
99+ with :
100+ name : arch
101+ path : |
102+ pkg/arch/*-aarch64.pkg.tar.zst
103+ pkg/arch/*-aarch64.pkg.tar.zst.sig
104+ pkg/arch/*-x86_64.pkg.tar.zst
105+ pkg/arch/*-x86_64.pkg.tar.zst.sig
106+ retention-days : 1
Original file line number Diff line number Diff line change 1+ pkgname=modctl
2+ pkgver=PKGVER
3+ pkgrel=1
4+ pkgdesc=" command line mod manager"
5+ arch=(aarch64 x86_64)
6+ url=https://modctl.org
7+ license=(GPL-3.0-or-later)
8+ depends=(glibc)
9+ source=(file://modctl
10+ file://modctl.bash
11+ file://modctl.fish
12+ file://modctl.zsh
13+ file://licenses.tar
14+ file://LICENSE)
15+ md5sums=(SKIP SKIP SKIP SKIP SKIP SKIP)
16+
17+ package () {
18+ install -Dm0755 " $srcdir /modctl" " $pkgdir /usr/bin/modctl"
19+ install -Dm0644 " $srcdir /LICENSE" " $pkgdir /usr/share/licenses/modctl/LICENSE"
20+ cp -r " $srcdir /licenses" " $pkgdir /usr/share/licenses/modctl/vendor"
21+ install -Dm0644 " $srcdir /modctl.bash" " $pkgdir /usr/share/bash-completions/completions/modctl"
22+ install -Dm0644 " $srcdir /modctl.fish" " $pkgdir /usr/share/fish/vendor_completions.d/modctl.fish"
23+ install -Dm0644 " $srcdir /modctl.zsh" " $pkgdir /usr/share/zsh/site-functions/_modctl"
24+ }
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ pkgver=" $( grep -P " ^\tVersion:" cmd/root.go | awk -F\" ' {print $2}' ) "
4+
5+ mkdir pkg/arch
6+ sed -e " s/PKGVER/$pkgver /" pkg/PKGBUILD > pkg/arch/PKGBUILD
7+ go-licenses save ./... --ignore github.com/mfinelli/modctl --save_path \
8+ pkg/licenses
9+ find pkg/licenses -type f -exec chmod 0644 {} \;
10+
11+ (
12+ cd pkg || exit 1
13+ tar cvf arch/licenses.tar licenses
14+ )
15+
16+ make
17+ ./modctl completion bash > pkg/arch/modctl.bash
18+ ./modctl completion fish > pkg/arch/modctl.fish
19+ ./modctl completion zsh > pkg/arch/modctl.zsh
20+ cp LICENSE pkg/arch
21+ mv modctl pkg/arch
22+
23+ (
24+ set -e
25+ chown -R builder:builder pkg/arch
26+ cd pkg/arch
27+ su builder -c " makepkg --nodeps"
28+ find . -name ' *-x86_64.pkg.tar.zst' -exec \
29+ gpg --detach-sign \
30+ -u pkg@modctl.org \
31+ {} \;
32+ )
33+
34+ export CC=aarch64-linux-gnu-gcc
35+ export GOARCH=arm64
36+ make modctl
37+ mv modctl pkg/arch
38+
39+ (
40+ set -e
41+ cd pkg/arch
42+ su builder -c " CARCH=aarch64 makepkg --nodeps"
43+ find . -name ' *-aarch64.pkg.tar.zst' -exec \
44+ gpg --detach-sign \
45+ -u pkg@modctl.org \
46+ {} \;
47+ )
Original file line number Diff line number Diff line change 2222
2323echo " $RCLONE_CONFIG " > pkg/rclone.conf
2424
25- echo " Pulling current repo state from R2..."
2625WORKDIR=" $( mktemp -d) "
2726mkdir -p " $WORKDIR /repo"
28- rclone sync --config pkg/rclone.conf r2:modctl-pkgs " $WORKDIR /repo"
27+
28+ if [[ " ${GITHUB_REF} " == refs/tags/v* ]]; then
29+ echo " Pulling current repo state from R2..."
30+ rclone sync --config pkg/rclone.conf r2:modctl-pkgs " $WORKDIR /repo"
31+ fi
2932
3033echo " Exporting public key..."
3134gpg --armor --export pkg@modctl.org > " $WORKDIR /repo/pubkey.asc"
102105
103106tree " $WORKDIR "
104107
105- rclone sync --config pkg/rclone.conf " $WORKDIR /repo" r2:modctl-pkgs
108+ if [[ " ${GITHUB_REF} " == refs/tags/v* ]]; then
109+ echo " Pushing updated repo to R2..."
110+ rclone sync --config pkg/rclone.conf " $WORKDIR /repo" r2:modctl-pkgs
111+ fi
106112
107113exit 0
You can’t perform that action at this time.
0 commit comments