Build Alpine packages for stable and edge
This commit is contained in:
@@ -13,27 +13,34 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build-and-publish:
|
build-and-publish:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- alpine_version: "3.23"
|
||||||
|
alpine_registry_branch: "v3.23"
|
||||||
|
- alpine_version: "edge"
|
||||||
|
alpine_registry_branch: "edge"
|
||||||
container:
|
container:
|
||||||
image: alpine:3.23
|
image: "alpine:${{ matrix.alpine_version }}"
|
||||||
env:
|
env:
|
||||||
ALPINE_VERSION: "3.23"
|
ALPINE_VERSION: "${{ matrix.alpine_version }}"
|
||||||
ALPINE_ARCHES: "x86_64 aarch64"
|
ALPINE_ARCHES: "x86_64 aarch64"
|
||||||
ALPINE_REGISTRY_BRANCH: "v3.23"
|
ALPINE_REGISTRY_BRANCH: "${{ matrix.alpine_registry_branch }}"
|
||||||
ALPINE_REGISTRY_REPOSITORY: "${{ vars.PACKAGE_NAME }}"
|
ALPINE_REGISTRY_REPOSITORY: "${{ vars.PACKAGE_NAME }}"
|
||||||
INSTANCE_URL: "${{ vars.INSTANCE_URL }}"
|
INSTANCE_URL: "${{ vars.INSTANCE_URL }}"
|
||||||
PACKAGE_OWNER: "${{ vars.PACKAGE_OWNER }}"
|
PACKAGE_OWNER: "${{ vars.PACKAGE_OWNER }}"
|
||||||
PACKAGE_USER: "${{ secrets.PACKAGE_USER }}"
|
PACKAGE_USER: "${{ secrets.PACKAGE_USER }}"
|
||||||
PACKAGE_TOKEN: "${{ secrets.PACKAGE_TOKEN }}"
|
PACKAGE_TOKEN: "${{ secrets.PACKAGE_TOKEN }}"
|
||||||
PACKAGER: "Joachim Schlöffel <me@joachim-schloeffel.com>"
|
PACKAGER: "Joachim Schlöffel <me@joachim-schloeffel.com>"
|
||||||
CARGO_HOME: "/cache/public-alpine-packages/greptimedb/cargo"
|
CARGO_HOME: "/cache/public-alpine-packages/${{ matrix.alpine_registry_branch }}/greptimedb/cargo"
|
||||||
RUSTUP_HOME: "/cache/public-alpine-packages/greptimedb/rustup"
|
RUSTUP_HOME: "/cache/public-alpine-packages/${{ matrix.alpine_registry_branch }}/greptimedb/rustup"
|
||||||
CARGO_TARGET_DIR: "/cache/public-alpine-packages/greptimedb/target"
|
CARGO_TARGET_DIR: "/cache/public-alpine-packages/${{ matrix.alpine_registry_branch }}/greptimedb/target"
|
||||||
steps:
|
steps:
|
||||||
- name: Prepare Environment
|
- name: Prepare Environment
|
||||||
run: |
|
run: |
|
||||||
apk add --no-cache --update abuild-rootbld alpine-sdk atools-apkbuild-lint bash ca-certificates curl doas git nodejs sudo tar
|
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"
|
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
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@@ -49,7 +56,7 @@ jobs:
|
|||||||
- name: Upload generated CI assets
|
- name: Upload generated CI assets
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: greptimedb-musl-binaries
|
name: greptimedb-musl-binaries-${{ matrix.alpine_registry_branch }}
|
||||||
path: packages/ci-assets/
|
path: packages/ci-assets/
|
||||||
|
|
||||||
- name: Smoke test
|
- name: Smoke test
|
||||||
|
|||||||
23
README.md
23
README.md
@@ -1,12 +1,13 @@
|
|||||||
# Alpine Packages
|
# 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
|
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
|
```text
|
||||||
https://code.factoring.digital/api/packages/public/alpine/v3.23/alpine-packages
|
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
|
## 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
|
https://code.factoring.digital/api/packages/public/alpine/key
|
||||||
```
|
```
|
||||||
|
|
||||||
Add the package repository:
|
Add the stable package repository:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
printf '%s\n' \
|
printf '%s\n' \
|
||||||
@@ -30,6 +31,16 @@ printf '%s\n' \
|
|||||||
apk update
|
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
|
If a forked or future registry is private, include a Gitea user and package token in the
|
||||||
repository URL:
|
repository URL:
|
||||||
|
|
||||||
@@ -322,9 +333,9 @@ Run `apk:checksum` after changing any file listed in `source=`.
|
|||||||
|
|
||||||
### Gitea Workflow
|
### Gitea Workflow
|
||||||
|
|
||||||
The workflow at `.gitea/workflows/build.yml` builds in an `alpine:3.23`
|
The workflow at `.gitea/workflows/build.yml` builds a matrix for `alpine:3.23`
|
||||||
container and publishes on push or tag. It skips publishing for pull request
|
and `alpine:edge`, publishing to registry branches `v3.23` and `edge` on push
|
||||||
events.
|
or tag. It skips publishing for pull request events.
|
||||||
|
|
||||||
Repository variables:
|
Repository variables:
|
||||||
|
|
||||||
|
|||||||
@@ -38,5 +38,11 @@ ALPINE_REPOSITORY_KEY_URL=https://code.factoring.digital/api/packages/public/alp
|
|||||||
mise run apk:test-install
|
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
|
The full build can take close to an hour. Do not run it as part of lightweight
|
||||||
metadata or script checks.
|
metadata or script checks.
|
||||||
|
|||||||
Reference in New Issue
Block a user