Skip to content

Commit e839085

Browse files
committed
github: Implement workflow for building all tags.
This currently only supports v21.7.0 onwards. Supporting older releases will be more difficult, but will hopefully be done at some point.
1 parent 04a1569 commit e839085

File tree

1 file changed

+121
-0
lines changed

1 file changed

+121
-0
lines changed
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
name: Build all pkgin release tags
2+
on:
3+
workflow_dispatch:
4+
jobs:
5+
build-tags:
6+
runs-on: ubuntu-24.04
7+
steps:
8+
- name: Checkout repository
9+
uses: actions/checkout@v4
10+
with:
11+
fetch-depth: 0
12+
- name: Set up host
13+
run: |
14+
sudo apt-get update
15+
sudo apt-get install -y \
16+
bmake \
17+
build-essential \
18+
cvs \
19+
libarchive-dev \
20+
libsqlite3-dev \
21+
libssl-dev
22+
mkdir ~/.ssh
23+
ssh-keyscan anoncvs.netbsd.org >>~/.ssh/known_hosts
24+
cvs -d anoncvs@anoncvs.netbsd.org:/cvsroot co -P \
25+
pkgsrc/net/libfetch/files \
26+
pkgsrc/pkgtools/libnbcompat/files \
27+
pkgsrc/pkgtools/pkg_install/files \
28+
pkgsrc/security/netpgpverify/files
29+
(
30+
cd pkgsrc/pkgtools/libnbcompat/files
31+
./configure --enable-db
32+
bmake
33+
)
34+
CFLAGS="-DHAVE_NBCOMPAT_H=1"
35+
CFLAGS="${CFLAGS} -I${GITHUB_WORKSPACE}/pkgsrc/pkgtools/libnbcompat/files"
36+
export CFLAGS
37+
(
38+
cd pkgsrc/net/libfetch/files
39+
export BINOWN="$(id -un)"
40+
export ROOT_GROUP="$(id -gn)"
41+
bmake
42+
bmake DESTDIR=/tmp/destdir install
43+
)
44+
(
45+
cd pkgsrc/security/netpgpverify/files
46+
./configure
47+
bmake
48+
bmake -f Makefile.lib.in
49+
)
50+
(
51+
cd pkgsrc/pkgtools/pkg_install/files
52+
sed -i -e '/optreset/d' admin/audit.c
53+
ln -s ${GITHUB_WORKSPACE}/pkgsrc/security/netpgpverify/files lib/netpgp
54+
cp ${GITHUB_WORKSPACE}/pkgsrc/security/netpgpverify/files/libnetpgpverify.a lib
55+
CFLAGS="${CFLAGS} -I${GITHUB_WORKSPACE}/pkgsrc/net/libfetch/files"
56+
CFLAGS="${CFLAGS} -I/tmp/destdir/usr/include"
57+
LDFLAGS="-L${GITHUB_WORKSPACE}/pkgsrc/pkgtools/libnbcompat/files"
58+
LDFLAGS="${LDFLAGS} -L/tmp/destdir/usr/lib"
59+
export LDFLAGS
60+
export LIBS="-lnbcompat"
61+
./configure --prefix=/usr
62+
bmake
63+
bmake DESTDIR=/tmp/destdir install
64+
)
65+
- name: Build each tag
66+
run: |
67+
mkdir bin
68+
for tag in $(git tag | grep ^v); do
69+
# TODO: < v0.10 require patches for PKGIN_DBDIR / PKG_INSTALL_DIR
70+
case "${tag}" in
71+
v0.[0-9].*)
72+
continue
73+
;;
74+
# TODO: some issues with the Makefile
75+
v0.*)
76+
continue
77+
;;
78+
# TODO: pre-automake, do not support out-of-srcdir
79+
v20.*)
80+
continue
81+
;;
82+
esac
83+
git checkout $tag
84+
mkdir build
85+
(
86+
cd build
87+
CONFIGURE_ARGS="--prefix=/usr/local"
88+
case "${tag}" in
89+
v0.*)
90+
CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-libraries=/tmp/destdir/usr/lib"
91+
CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-includes=/tmp/destdir/usr/include"
92+
CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-pkginstall=/tmp/destdir/usr/sbin"
93+
;;
94+
*)
95+
CONFIGURE_ARGS="${CONFIGURE_ARGS} --disable-maintainer-mode"
96+
CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-dbdir=/usr/local/.pkgdb"
97+
CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-libarchive=/usr"
98+
CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-libfetch=/tmp/destdir/usr"
99+
CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-openssl=/usr"
100+
CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-sqlite3=/usr"
101+
CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-machine-arch=x86_64"
102+
CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-pkg-install=/tmp/destdir/usr/sbin"
103+
;;
104+
esac
105+
env \
106+
CFLAGS="-DHAVE_NBCOMPAT_H=1 -I${GITHUB_WORKSPACE}/pkgsrc/pkgtools/libnbcompat/files" \
107+
LDFLAGS="-L${GITHUB_WORKSPACE}/pkgsrc/pkgtools/libnbcompat/files" \
108+
LIBS="-lnbcompat" \
109+
../configure ${CONFIGURE_ARGS} || (cat config.log && ./configure --help && false)
110+
bmake || make V=1
111+
)
112+
mv build/pkgin bin/pkgin-"$tag"
113+
rm -rf build
114+
done
115+
cp /tmp/destdir/usr/sbin/pkg_* ./bin
116+
tar -czvf pkgin-bins.tar.gz ./bin
117+
- name: Upload artifacts
118+
uses: actions/upload-artifact@v4
119+
with:
120+
name: pkgin-binaries
121+
path: pkgin-bins.tar.gz

0 commit comments

Comments
 (0)