Skip to content

Commit ff5edec

Browse files
aberohamclaude
andcommitted
spring cleaning: metadata, CI containerization, release workflow
Housekeeping - Add root AGPL-3.0 LICENSE file - Fix surname across all source files and Makefile.PL AUTHOR fields - Remove stale META.yml files (generated by make dist) - Update README with current status, Docker quickstart, fix forum link - Add .gitignore entry for test-results/ CI: container-based builds - Multi-stage Dockerfile (dist/docker/Dockerfile): base stage has all deps pre-installed, production stage adds source and entrypoint. CI builds --target base; docker.yml builds the full production image. - ci.yml: runs Perl tests in the CI container with MySQL 8 service container (replaces bare-runner apt-get/cpanm from scratch) - ci-image.yml: builds and pushes the CI base image to GHCR on master when Dockerfile or Makefile.PL dependencies change - docker.yml: updated to actions/checkout@v6 and ubuntu-24.04 Release workflow - Automated release via workflow_dispatch with version input - Preflight validation (format, tag existence, version ordering) - Container-based test suite (same as CI) - Version bump, commit, tag, push - Build and upload Perl distribution tarballs to GitHub Releases - Build and push production Docker image to GHCR with version tags Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent aa66715 commit ff5edec

108 files changed

Lines changed: 1182 additions & 427 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci-image.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CI Image
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths:
7+
- 'dist/docker/Dockerfile'
8+
- '.github/workflows/ci-image.yml'
9+
- 'server/Makefile.PL'
10+
- 'client/Makefile.PL'
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: read
15+
packages: write
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-24.04
20+
steps:
21+
- uses: actions/checkout@v6
22+
23+
- name: Compute image tag
24+
id: meta
25+
run: echo "tag=ghcr.io/${GITHUB_REPOSITORY,,}/build:latest" >> "$GITHUB_OUTPUT"
26+
27+
- uses: docker/setup-buildx-action@v4
28+
29+
- uses: docker/login-action@v4
30+
with:
31+
registry: ghcr.io
32+
username: ${{ github.actor }}
33+
password: ${{ secrets.GITHUB_TOKEN }}
34+
35+
- uses: docker/build-push-action@v7
36+
with:
37+
context: .
38+
file: dist/docker/Dockerfile
39+
target: base
40+
push: true
41+
tags: ${{ steps.meta.outputs.tag }}
42+
cache-from: type=gha
43+
cache-to: type=gha,mode=max

.github/workflows/ci.yml

Lines changed: 44 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -13,69 +13,41 @@ on:
1313

1414
permissions:
1515
contents: read
16+
packages: read
1617

1718
jobs:
19+
image-name:
20+
runs-on: ubuntu-24.04
21+
outputs:
22+
ci: ${{ steps.set.outputs.ci }}
23+
steps:
24+
- id: set
25+
run: echo "ci=ghcr.io/${GITHUB_REPOSITORY,,}/build:latest" >> "$GITHUB_OUTPUT"
26+
1827
test:
19-
runs-on: ubuntu-22.04
28+
needs: image-name
29+
runs-on: ubuntu-24.04
30+
container:
31+
image: ${{ needs.image-name.outputs.ci }}
32+
credentials:
33+
username: ${{ github.actor }}
34+
password: ${{ secrets.GITHUB_TOKEN }}
35+
36+
services:
37+
mysql:
38+
image: mysql:8
39+
env:
40+
MYSQL_ROOT_PASSWORD: root
41+
MYSQL_DATABASE: nictool
42+
options: >-
43+
--health-cmd="mysqladmin ping -h 127.0.0.1"
44+
--health-interval=5s
45+
--health-timeout=3s
46+
--health-retries=10
2047
2148
steps:
2249
- uses: actions/checkout@v6
2350

24-
- name: Install system dependencies
25-
run: |
26-
sudo apt-get update
27-
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y \
28-
expat \
29-
cpanminus \
30-
libdbix-simple-perl \
31-
libdbd-mysql-perl \
32-
apache2 \
33-
libapache2-mod-perl2 \
34-
libapache2-mod-perl2-dev \
35-
libapache-dbi-perl \
36-
gettext \
37-
libxml2 \
38-
libnet-ip-perl \
39-
libxml-libxml-perl \
40-
libxml-parser-perl \
41-
libdigest-hmac-perl \
42-
libjson-perl \
43-
librpc-xml-perl \
44-
libsoap-lite-perl \
45-
libmodule-build-perl \
46-
libmime-base32-perl \
47-
libmime-base64-perl \
48-
libbind-confparser-perl \
49-
libssl-dev \
50-
libcrypt-openssl-rsa-perl \
51-
libcrypt-openssl-dsa-perl \
52-
libnet-dns-perl \
53-
libyaml-perl \
54-
bind9utils \
55-
libwww-perl \
56-
liburi-perl \
57-
libmime-tools-perl \
58-
libmailtools-perl \
59-
libfile-sharedir-perl \
60-
libperl-prereqscanner-perl \
61-
libdbi-perl \
62-
libcgi-pm-perl \
63-
libtest-pod-perl \
64-
libtest-output-perl \
65-
libtest-simple-perl \
66-
default-mysql-client
67-
68-
- name: Wait for MySQL service
69-
run: |
70-
sudo /etc/init.d/mysql start
71-
for attempt in $(seq 1 10); do
72-
if mysqladmin ping -h 127.0.0.1 --silent; then
73-
exit 0
74-
fi
75-
sleep 2
76-
done
77-
exit 1
78-
7951
- name: Generate test credentials
8052
run: |
8153
DB_PW=$(openssl rand -base64 24)
@@ -85,42 +57,34 @@ jobs:
8557
echo "NICTOOL_DB_USER=nictool" >> "$GITHUB_ENV"
8658
echo "NICTOOL_DB_NAME=nictool" >> "$GITHUB_ENV"
8759
echo "DB_ENGINE=mysql" >> "$GITHUB_ENV"
88-
echo "DB_HOSTNAME=localhost" >> "$GITHUB_ENV"
60+
echo "DB_HOSTNAME=mysql" >> "$GITHUB_ENV"
8961
echo "ROOT_USER_EMAIL=ci@nictool.test" >> "$GITHUB_ENV"
9062
echo "ROOT_USER_PASSWORD=$ROOT_PW" >> "$GITHUB_ENV"
9163
echo "NICTOOL_CLIENT_DIR=$GITHUB_WORKSPACE/client" >> "$GITHUB_ENV"
92-
echo "DB_SSL=1" >> "$GITHUB_ENV"
64+
65+
- name: Install NicTool client and server
66+
run: |
67+
cd "$GITHUB_WORKSPACE/client"
68+
perl Makefile.PL
69+
cpanm -n .
70+
71+
cd "$GITHUB_WORKSPACE/server"
72+
perl Makefile.PL
73+
cpanm -n .
9374
9475
- name: Allow Apache to traverse workspace path
9576
run: |
96-
# Ubuntu 21.04+ defaults home dirs to 750; www-data needs o+x to traverse
9777
dir="$GITHUB_WORKSPACE"
9878
while [ "$dir" != "/" ]; do
99-
sudo chmod o+x "$dir"
79+
chmod o+x "$dir"
10080
dir="$(dirname "$dir")"
10181
done
10282
10383
- name: Set up NicTool configs, Apache, and TLS
104-
run: sudo -E dist/setup/install-nictool.sh --nt-dir="$GITHUB_WORKSPACE"
105-
106-
- name: Install Perl modules for Apache/mod_perl
107-
run: |
108-
sudo cpanm --notest \
109-
CryptX Crypt::Mac::HMAC Crypt::KeyDerivation \
110-
Test::HTML::Lint Time::TAI64 DBD::MariaDB
111-
112-
- name: Install NicTool client and server
113-
run: |
114-
cd "$GITHUB_WORKSPACE/client"
115-
perl Makefile.PL
116-
sudo cpanm -n .
117-
118-
cd "$GITHUB_WORKSPACE/server"
119-
perl Makefile.PL
120-
sudo cpanm -n .
84+
run: dist/setup/install-nictool.sh --nt-dir="$GITHUB_WORKSPACE"
12185

122-
- name: Restart Apache
123-
run: sudo service apache2 restart || sudo cat /var/log/apache2/error.log
86+
- name: Start Apache
87+
run: apachectl start
12488

12589
- name: Create NicTool test database
12690
run: |
@@ -139,9 +103,6 @@ jobs:
139103
- name: Failure diagnostics
140104
if: failure()
141105
run: |
142-
pwd
143106
mysql --version
144107
apache2 -version
145-
sudo cat /var/log/apache2/error.log || true
146-
cat /etc/apache2/apache2.conf || true
147-
ls /usr/lib/apache2/modules/ || true
108+
cat /var/log/apache2/error.log || true

.github/workflows/docker.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ permissions:
1414

1515
jobs:
1616
build:
17-
runs-on: ubuntu-22.04
17+
runs-on: ubuntu-24.04
1818
steps:
1919
- uses: actions/checkout@v6
2020

2121
- name: Set up Docker Buildx
22-
uses: docker/setup-buildx-action@v3
22+
uses: docker/setup-buildx-action@v4
2323

2424
- name: Build Docker image
25-
uses: docker/build-push-action@v6
25+
uses: docker/build-push-action@v7
2626
with:
2727
context: .
2828
file: dist/docker/Dockerfile
@@ -32,15 +32,15 @@ jobs:
3232

3333
docker-tests:
3434
needs: build
35-
runs-on: ubuntu-22.04
35+
runs-on: ubuntu-24.04
3636
steps:
3737
- uses: actions/checkout@v6
3838

3939
- name: Set up Docker Buildx
40-
uses: docker/setup-buildx-action@v3
40+
uses: docker/setup-buildx-action@v4
4141

4242
- name: Load Docker image from cache
43-
uses: docker/build-push-action@v6
43+
uses: docker/build-push-action@v7
4444
with:
4545
context: .
4646
file: dist/docker/Dockerfile
@@ -72,15 +72,15 @@ jobs:
7272
7373
e2e-tests:
7474
needs: build
75-
runs-on: ubuntu-22.04
75+
runs-on: ubuntu-24.04
7676
steps:
7777
- uses: actions/checkout@v6
7878

7979
- name: Set up Docker Buildx
80-
uses: docker/setup-buildx-action@v3
80+
uses: docker/setup-buildx-action@v4
8181

8282
- name: Load Docker image from cache
83-
uses: docker/build-push-action@v6
83+
uses: docker/build-push-action@v7
8484
with:
8585
context: .
8686
file: dist/docker/Dockerfile
@@ -99,14 +99,14 @@ jobs:
9999
timeout-minutes: 5
100100

101101
- name: Set up Node.js
102-
uses: actions/setup-node@v4
102+
uses: actions/setup-node@v6
103103
with:
104104
node-version: 22
105105
cache: npm
106106
cache-dependency-path: client/t/e2e/package-lock.json
107107

108108
- name: Cache Playwright browsers
109-
uses: actions/cache@v4
109+
uses: actions/cache@v5
110110
id: playwright-cache
111111
with:
112112
path: ~/.cache/ms-playwright

0 commit comments

Comments
 (0)