name: Build Alpine Packages on: schedule: - cron: "17 5 * * 1" push: branches: - master - main tags: - "*" pull_request: workflow_dispatch: jobs: build-and-publish: runs-on: ubuntu-latest strategy: matrix: include: - alpine_version: "3.24" alpine_registry_branch: "v3.24" container: image: "alpine:${{ matrix.alpine_version }}" env: ALPINE_VERSION: "${{ matrix.alpine_version }}" ALPINE_ARCHES: "x86_64 aarch64" 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: "${{ gitea.repository_owner }}" ALPINE_APK_REPO_CACHE: "/cache/public-alpine-packages/${{ matrix.alpine_registry_branch }}/apk-repo" 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 "$ALPINE_APK_REPO_CACHE" "$CARGO_HOME" "$RUSTUP_HOME" "$CARGO_TARGET_DIR" chown -R 1000:1000 /cache/public-alpine-packages/${{ matrix.alpine_registry_branch }} - name: Checkout uses: actions/checkout@v3 - name: Select packages run: | scripts/apk/clean.sh find packaging/alpine/local -mindepth 2 -maxdepth 2 -name APKBUILD -exec apkbuild-lint {} + scripts/apk/outdated.sh | tee update-check.txt if [ -n "${GITHUB_STEP_SUMMARY:-}" ]; then { echo "## Upstream update check" echo echo '```text' cat update-check.txt echo '```' } >> "$GITHUB_STEP_SUMMARY" fi - name: Prepare package cache if: github.event_name != 'schedule' run: | scripts/apk/ci-package-cache.sh prepare - name: Build packages if: github.event_name != 'schedule' run: | scripts/apk/ci-build.sh scripts/apk/ci-package-cache.sh sync scripts/apk/export-ci-assets.sh scripts/apk/list-packages.sh - name: Check artifact upload support if: github.event_name != 'schedule' id: artifact-upload run: | if [ -n "${ACTIONS_RUNTIME_TOKEN:-}" ]; then echo "available=true" >> "$GITHUB_OUTPUT" else echo "available=false" >> "$GITHUB_OUTPUT" fi - name: Upload generated CI assets if: github.event_name != 'schedule' && steps.artifact-upload.outputs.available == 'true' uses: actions/upload-artifact@v3 with: name: greptimedb-musl-binaries-${{ matrix.alpine_registry_branch }} path: packages/ci-assets/ - name: Smoke test if: github.event_name != 'schedule' run: scripts/apk/ci-smoke.sh - name: Runtime test if: github.event_name != 'schedule' run: scripts/apk/runtime-test.sh - name: Publish Alpine packages if: github.event_name != 'pull_request' && github.event_name != 'schedule' run: scripts/apk/publish-gitea.sh