From 92a0caed5b1b1f224e0252d74610c8101ad9b1bb Mon Sep 17 00:00:00 2001 From: Soner Sayakci Date: Mon, 25 Mar 2024 21:29:32 +0100 Subject: [PATCH] ci: add workflow to build all packages --- .github/workflows/build-all.yaml | 62 ++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/build-all.yaml diff --git a/.github/workflows/build-all.yaml b/.github/workflows/build-all.yaml new file mode 100644 index 0000000..e803f06 --- /dev/null +++ b/.github/workflows/build-all.yaml @@ -0,0 +1,62 @@ +name: Build All + +on: + workflow_dispatch: + push: + +jobs: + build: + runs-on: ubuntu-latest + container: + image: ghcr.io/wolfi-dev/sdk:latest + options: | + --cap-add NET_ADMIN --cap-add SYS_ADMIN --device /dev/fuse --security-opt seccomp=unconfined --security-opt apparmor:unconfined + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install rclone + run: | + cd /tmp + curl -o rclone.zip -L https://downloads.rclone.org/rclone-current-linux-amd64.zip + unzip rclone.zip + cp rclone*/rclone /usr/bin/ + rm -rf rclone* + + - name: Rclone Setup + run: | + mkdir -p $HOME/.config/rclone + cat < $HOME/.config/rclone/rclone.conf + [Packages] + type = s3 + provider = Cloudflare + env_auth = true + region = auto + endpoint = https://963ff7fb9c523564b5f3a398ab39d488.r2.cloudflarestorage.com + EOF + + - name: Create packages directory + run: mkdir -p packages + + - name: Get signing key + run: | + echo "${{ secrets.SIGNING_KEY }}" | base64 -d > melange.rsa + + - name: Build packages + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + run: | + rclone mount Packages:wolfi-php packages --allow-other --write-back-cache --vfs-cache-mode full -vvv & + pid=$! + + for file in *.yaml; do + melange build \ + --arch x86_64 \ + -r https://packages.wolfi.dev/os \ + -k https://packages.wolfi.dev/os/wolfi-signing.rsa.pub \ + --signing-key melange.rsa \ + $file + done + + kill $pid