Build Alpine packages for stable and edge

This commit is contained in:
Joachim Schlöffel
2026-06-09 11:00:42 +02:00
parent 2a965b05d5
commit 74207600cc
3 changed files with 38 additions and 14 deletions

View File

@@ -13,27 +13,34 @@ on:
jobs:
build-and-publish:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- alpine_version: "3.23"
alpine_registry_branch: "v3.23"
- alpine_version: "edge"
alpine_registry_branch: "edge"
container:
image: alpine:3.23
image: "alpine:${{ matrix.alpine_version }}"
env:
ALPINE_VERSION: "3.23"
ALPINE_VERSION: "${{ matrix.alpine_version }}"
ALPINE_ARCHES: "x86_64 aarch64"
ALPINE_REGISTRY_BRANCH: "v3.23"
ALPINE_REGISTRY_BRANCH: "${{ matrix.alpine_registry_branch }}"
ALPINE_REGISTRY_REPOSITORY: "${{ vars.PACKAGE_NAME }}"
INSTANCE_URL: "${{ vars.INSTANCE_URL }}"
PACKAGE_OWNER: "${{ vars.PACKAGE_OWNER }}"
PACKAGE_USER: "${{ secrets.PACKAGE_USER }}"
PACKAGE_TOKEN: "${{ secrets.PACKAGE_TOKEN }}"
PACKAGER: "Joachim Schlöffel <me@joachim-schloeffel.com>"
CARGO_HOME: "/cache/public-alpine-packages/greptimedb/cargo"
RUSTUP_HOME: "/cache/public-alpine-packages/greptimedb/rustup"
CARGO_TARGET_DIR: "/cache/public-alpine-packages/greptimedb/target"
CARGO_HOME: "/cache/public-alpine-packages/${{ matrix.alpine_registry_branch }}/greptimedb/cargo"
RUSTUP_HOME: "/cache/public-alpine-packages/${{ matrix.alpine_registry_branch }}/greptimedb/rustup"
CARGO_TARGET_DIR: "/cache/public-alpine-packages/${{ matrix.alpine_registry_branch }}/greptimedb/target"
steps:
- name: Prepare Environment
run: |
apk add --no-cache --update abuild-rootbld alpine-sdk atools-apkbuild-lint bash ca-certificates curl doas git nodejs sudo tar
mkdir -p "$CARGO_HOME" "$RUSTUP_HOME" "$CARGO_TARGET_DIR"
chown 1000:1000 /cache /cache/public-alpine-packages /cache/public-alpine-packages/greptimedb "$CARGO_HOME" "$RUSTUP_HOME" "$CARGO_TARGET_DIR"
chown 1000:1000 /cache /cache/public-alpine-packages /cache/public-alpine-packages/${{ matrix.alpine_registry_branch }} /cache/public-alpine-packages/${{ matrix.alpine_registry_branch }}/greptimedb "$CARGO_HOME" "$RUSTUP_HOME" "$CARGO_TARGET_DIR"
- name: Checkout
uses: actions/checkout@v3
@@ -49,7 +56,7 @@ jobs:
- name: Upload generated CI assets
uses: actions/upload-artifact@v3
with:
name: greptimedb-musl-binaries
name: greptimedb-musl-binaries-${{ matrix.alpine_registry_branch }}
path: packages/ci-assets/
- name: Smoke test

View File

@@ -1,12 +1,13 @@
# Alpine Packages
Alpine 3.23 packaging for internal packages.
Alpine stable and edge packaging for internal packages.
This repository builds signed `x86_64` and `aarch64` APKs and publishes them to
the Gitea Alpine package registry under:
the Gitea Alpine package registry under stable and edge branches:
```text
https://code.factoring.digital/api/packages/public/alpine/v3.23/alpine-packages
https://code.factoring.digital/api/packages/public/alpine/edge/alpine-packages
```
## Use In Production
@@ -20,7 +21,7 @@ curl -fsSLo /etc/apk/keys/public-alpine.rsa.pub \
https://code.factoring.digital/api/packages/public/alpine/key
```
Add the package repository:
Add the stable package repository:
```sh
printf '%s\n' \
@@ -30,6 +31,16 @@ printf '%s\n' \
apk update
```
Use the edge branch on Alpine edge nodes:
```sh
printf '%s\n' \
'https://code.factoring.digital/api/packages/public/alpine/edge/alpine-packages' \
>> /etc/apk/repositories
apk update
```
If a forked or future registry is private, include a Gitea user and package token in the
repository URL:
@@ -322,9 +333,9 @@ Run `apk:checksum` after changing any file listed in `source=`.
### Gitea Workflow
The workflow at `.gitea/workflows/build.yml` builds in an `alpine:3.23`
container and publishes on push or tag. It skips publishing for pull request
events.
The workflow at `.gitea/workflows/build.yml` builds a matrix for `alpine:3.23`
and `alpine:edge`, publishing to registry branches `v3.23` and `edge` on push
or tag. It skips publishing for pull request events.
Repository variables:

View File

@@ -38,5 +38,11 @@ ALPINE_REPOSITORY_KEY_URL=https://code.factoring.digital/api/packages/public/alp
mise run apk:test-install
```
Use the `edge` branch on Alpine edge nodes:
```sh
ALPINE_REPOSITORY_URL=https://code.factoring.digital/api/packages/public/alpine/edge/alpine-packages
```
The full build can take close to an hour. Do not run it as part of lightweight
metadata or script checks.