-
Notifications
You must be signed in to change notification settings - Fork 0
Enable Debian Build,Sign,Publish via GH Actions #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
endersonmaia
wants to merge
54
commits into
main
Choose a base branch
from
feature/ci-debian-build-multiple-archs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
b50d94f
feat: add package scripts for Debian and Alpine
edubart c4c076b
feat: bump emulator, rootfs and tools
edubart 461ded2
feat: bump emulator (0.20.0), rootfs and tools (0.17.2)
endersonmaia 6e1ab5d
feat(alpine): bump Alpine to 3.23, fix TARGET_ARCH for docker
endersonmaia 51cfc31
feat: fix build for Alpine
endersonmaia 0f2e1ba
feat(debian): stick to ubuntu:noble
endersonmaia 4c9d942
docs: use cartesi.github.io/linux-packages
endersonmaia 146853d
feat(debian): enable CI build with multiple architecture
endersonmaia e23ea7b
feat(debian): use docker/buid-push-action
endersonmaia e6c66c6
feat(debian): split sign step
endersonmaia ed5464f
feat(debian): enable cache in CI
endersonmaia 55587f1
feat(debian): add packages-info target
endersonmaia 1347933
feat(debian): add test step to CI
endersonmaia 287acef
feat(debian): test works without signed packages
endersonmaia ea58bba
feat(debian): test works with select packages
endersonmaia ef2d04a
feat(debian): add sign job
endersonmaia 90e6a6a
feat(debian): add publish job
endersonmaia 587f266
feat(build): limit PACKAGES_ALLARCH build only for amd64
endersonmaia 3ab10ee
feat(debian): update docs
endersonmaia 3c8d2e8
ci(debian): add debian:trixie to test matrix
endersonmaia 19addab
feat: persist cdn/apt in git lfs cdn branch
endersonmaia 931fd38
feat(alpine): enable CI build with multiple architecture
endersonmaia 78e3ffa
ci(debian): limit jobs to debian/ scope
endersonmaia ead20cd
feat(alpine): fetch cdn/ before sync, upload
endersonmaia 0e1a478
chore(alpine): set e-mail address
endersonmaia 154c8eb
feat: use cdn branch to avoid rebuilding
endersonmaia 9398083
feat: add remote repository to build scripts
endersonmaia 1fce2a8
feat: only test,sign if packages were built
endersonmaia 26802b5
feat: get CDN files before index and sign
endersonmaia 82c8947
fix: .sh execution permissions
endersonmaia 035aba3
fix: avoid rm failing
endersonmaia db32c9c
refactor: builder images
endersonmaia 8da162a
fix(alpine): inject KEY_NAME to setup-env.sh
endersonmaia cec78bb
feat: improve reproducibility
endersonmaia 9a637f5
feat: add cartesi-rollups-node Debian and Alpine packages
endersonmaia b8a3c42
fix(alpine): download .apk from git LFS
endersonmaia 1c6f4f1
feat(debian): bump cartesi-machine-guest-linux-headers to 0.21.0
endersonmaia a0cc75e
feat(debian): bump cartesi-machine-linux-image to 0.21.0
endersonmaia 8bf76f1
feat(debian): bump cartesi-machine-guest-tools to 0.18.0
endersonmaia ba21c76
feat(debian): bump cartesi-machine-rootfs-image to 0.18.0
endersonmaia a2e9b87
feat(debian): bump cartesi-machine-emulator to 0.21.0
endersonmaia 432d302
feat(alpine): bump cartesi-machine-guest-linux-headers to 0.21.0
endersonmaia 8a9549c
feat(alpine): bump cartesi-machine-linux-image to 0.21.0
endersonmaia 7617d08
feat(alpine): bump cartesi-machine-guest-tools to 0.18.0
endersonmaia 0430b41
feat(alpine): bump cartesi-machine-rootfs-image to 0.18.0
endersonmaia 4454411
feat(alpine): bump cartesi-machine-emulator to 0.21.0
endersonmaia 072b6cc
fix(rollups-node): cap Build-Depends/makedepends on cartesi-machine-e…
endersonmaia d2454d6
fix(test-packages): install/test each package in its own isolated tra…
endersonmaia 43a6523
fix(test-packages): run per-package test loop inside one container, n…
endersonmaia 0a8f596
ci: add riscv64 specific build
endersonmaia e4dbdab
ci: npx actions-up
endersonmaia 33da530
ci: publish do AWS S3
endersonmaia 0ad7c4b
ci: remove some steps
endersonmaia 82920eb
ci: test right after build
endersonmaia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,184 @@ | ||
| name: Alpine Packages | ||
| on: | ||
| push: | ||
| paths: | ||
| - ".github/workflows/alpine.yml" | ||
| - "alpine/**" | ||
|
|
||
| jobs: | ||
| alpine-build: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - runner: ubuntu-24.04 | ||
| arch: x86_64 | ||
| docker_arch: amd64 | ||
| - runner: ubuntu-24.04-arm | ||
| arch: aarch64 | ||
| docker_arch: arm64 | ||
| - runner: ubuntu-24.04-riscv | ||
| arch: riscv64 | ||
| docker_arch: riscv64 | ||
|
|
||
| runs-on: ${{ matrix.runner }} | ||
| name: Alpine Build | ||
| permissions: | ||
| packages: write | ||
| contents: read | ||
| id-token: write | ||
| steps: | ||
| - name: Checkout source code | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| submodules: recursive | ||
|
|
||
| - name: Setup up Docker Buildx | ||
| uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0 | ||
|
|
||
| - name: Make builder container image | ||
| uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0 | ||
| with: | ||
| context: alpine | ||
| file: alpine/Dockerfile | ||
| platforms: linux/${{ matrix.docker_arch }} | ||
| tags: cartesi/apk-builder-${{ matrix.docker_arch }} | ||
| load: true | ||
| push: false | ||
| cache-from: type=gha,scope=${{ matrix.docker_arch }} | ||
| cache-to: type=gha,scope=${{ matrix.docker_arch }},mode=max | ||
|
|
||
| - name: Generate disposable build keys | ||
| working-directory: alpine | ||
| run: make key KEY_NAME=disposable | ||
|
|
||
| - name: Build not riscv64 packages | ||
| id: build-all | ||
| if: matrix.arch != 'riscv64' | ||
| continue-on-error: true | ||
| working-directory: alpine | ||
| run: make packages TARGET_ARCH=${{ matrix.arch }} KEY_NAME=disposable | ||
|
|
||
| - name: Test not riscv64 packages | ||
| id: test-all | ||
| if: matrix.arch != 'riscv64' | ||
| continue-on-error: true | ||
| working-directory: alpine | ||
| run: make -k test TARGET_ARCH=${{ matrix.arch }} KEY_NAME=disposable | ||
|
|
||
| - name: Build riscv64 packages only | ||
| id: build-riscv64 | ||
| if: matrix.arch == 'riscv64' | ||
| continue-on-error: true | ||
| working-directory: alpine | ||
| run: make -k packages TARGET_ARCH=${{ matrix.arch }} KEY_NAME=disposable PACKAGES="cartesi-machine-linux-image cartesi-machine-rootfs-image cartesi-machine-guest-linux-headers cartesi-machine-guest-tools" | ||
|
|
||
| - name: Test riscv64 packages only | ||
| id: test-riscv64 | ||
| if: matrix.arch == 'riscv64' | ||
| continue-on-error: true | ||
| working-directory: alpine | ||
| run: make -k test TARGET_ARCH=${{ matrix.arch }} KEY_NAME=disposable PACKAGES="cartesi-machine-linux-image cartesi-machine-rootfs-image cartesi-machine-guest-linux-headers cartesi-machine-guest-tools" | ||
|
|
||
| - name: Export builder container image | ||
| run: docker save cartesi/apk-builder-${{ matrix.docker_arch }} | gzip > /tmp/apk-builder-${{ matrix.docker_arch }}.tar.gz | ||
|
|
||
| - name: Upload builder container image | ||
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | ||
| with: | ||
| name: image-apk-builder-${{ matrix.docker_arch }} | ||
| path: /tmp/apk-builder-${{ matrix.docker_arch }}.tar.gz | ||
|
|
||
| - name: Upload artifacts | ||
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | ||
| with: | ||
| name: artifacts-apk-${{ matrix.arch }} | ||
| path: cdn/apk | ||
|
|
||
| alpine-sign: | ||
| runs-on: ubuntu-24.04 | ||
| name: Alpine Signing | ||
| needs: [alpine-build] | ||
| #FIXME: uncomment when process is validated | ||
| #if: (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) | ||
| environment: signing | ||
| steps: | ||
| - name: Checkout source code | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| submodules: recursive | ||
|
|
||
| - name: Download apk artifacts | ||
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||
| with: | ||
| pattern: artifacts-apk-* | ||
| path: cdn/apk/ | ||
| merge-multiple: true | ||
|
|
||
| - name: Download builder images | ||
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||
| with: | ||
| pattern: image-apk-builder-* | ||
| path: /tmp/images | ||
|
|
||
| - name: Import builder image | ||
| run: find /tmp/images -name '*.tar.gz' | xargs -I {} docker image load --input {} | ||
|
|
||
| - name: Import APK signing key | ||
| working-directory: alpine | ||
| env: | ||
| APK_KEY: ${{ secrets.APK_KEY }} | ||
| APK_PUB_KEY: ${{ vars.APK_PUB_KEY }} | ||
| run: | | ||
| mkdir -p key | ||
| chmod 700 key | ||
| echo "$APK_KEY" > key/cartesi-apk-key.rsa | ||
| echo "$APK_PUB_KEY" > key/cartesi-apk-key.rsa.pub | ||
| echo "PACKAGER_PRIVKEY=/root/.abuild/cartesi-apk-key.rsa" > key/abuild.conf | ||
|
|
||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4.2.0 | ||
|
|
||
| - name: Sign packages | ||
| working-directory: alpine | ||
| run: | | ||
| make re-sign TARGET_ARCH=x86_64 KEY_NAME=cartesi-apk-key | ||
| make re-sign TARGET_ARCH=aarch64 KEY_NAME=cartesi-apk-key | ||
| make re-sign TARGET_ARCH=riscv64 KEY_NAME=cartesi-apk-key | ||
|
|
||
| - name: Upload signed artifacts | ||
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | ||
| with: | ||
| name: signed-artifacts-apk | ||
| path: cdn/apk | ||
|
|
||
| publish: | ||
| name: Alpine Publish | ||
| needs: alpine-sign | ||
| #FIXME: uncomment when process is validated | ||
| #if: startsWith(github.ref, 'refs/tags/v') | ||
| runs-on: ubuntu-24.04 | ||
| permissions: | ||
| id-token: write | ||
| steps: | ||
| - name: Download signed archives | ||
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||
| with: | ||
| name: signed-artifacts-apk | ||
| path: incoming/apk/ | ||
|
|
||
| - name: Replace disposable key with production public key | ||
| env: | ||
| APK_PUB_KEY: ${{ vars.APK_PUB_KEY }} | ||
| run: | | ||
| rm -f incoming/apk/keys/disposable.rsa.pub | ||
| echo "$APK_PUB_KEY" > incoming/apk/keys/cartesi-apk-key.rsa.pub | ||
|
|
||
| - name: Configure AWS credentials | ||
| uses: aws-actions/configure-aws-credentials@e6de054238d6b7531b4efff3b6587d9aade6a06c # v6.2.3 | ||
| with: | ||
| role-to-assume: ${{ secrets.DIST_S3_ROLE_ARN }} | ||
| aws-region: us-east-1 | ||
|
|
||
| - name: Publish to S3 | ||
| run: aws s3 cp incoming/apk "s3://${{ secrets.DIST_S3_BUCKET_NAME }}/linux/apk" --recursive |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,189 @@ | ||
| name: Debian Packages | ||
| on: | ||
| push: | ||
| paths: | ||
| - ".github/workflows/debian.yml" | ||
| - "debian/**" | ||
|
|
||
| jobs: | ||
| debian-build: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - runner: ubuntu-24.04 | ||
| arch: amd64 | ||
| packages_allarch: "cartesi-machine-linux-image cartesi-machine-rootfs-image" | ||
| - runner: ubuntu-24.04-arm | ||
| arch: arm64 | ||
| packages_allarch: "" | ||
| - runner: ubuntu-24.04-riscv | ||
| arch: riscv64 | ||
| packages_allarch: "" | ||
|
|
||
| runs-on: ${{ matrix.runner }} | ||
| name: Debian Build | ||
| permissions: | ||
| packages: write | ||
| contents: read | ||
| id-token: write | ||
| steps: | ||
| - name: Checkout source code | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| submodules: recursive | ||
|
|
||
| - name: Setup up Docker Buildx | ||
| uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0 | ||
|
|
||
| - name: Make builder container image | ||
| uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0 | ||
| with: | ||
| context: debian | ||
| file: debian/Dockerfile | ||
| platforms: linux/${{ matrix.arch }} | ||
| tags: cartesi/deb-builder-${{ matrix.arch }} | ||
| load: true | ||
| push: false | ||
| cache-from: type=gha,scope=${{ matrix.arch }} | ||
| cache-to: type=gha,scope=${{ matrix.arch }},mode=max | ||
|
|
||
| - name: Build not riscv64 packages | ||
| id: build-all | ||
| if: matrix.arch != 'riscv64' | ||
| continue-on-error: true | ||
| working-directory: debian | ||
| run: | | ||
| make packages \ | ||
| TARGET_ARCH=${{ matrix.arch }} \ | ||
| PACKAGES_ALLARCH="${{ matrix.packages_allarch }}" | ||
|
|
||
| - name: Test not riscv64 packages | ||
| id: test-all | ||
| if: matrix.arch != 'riscv64' | ||
| continue-on-error: true | ||
| working-directory: debian | ||
| run: | | ||
| make -k test \ | ||
| TARGET_ARCH=${{ matrix.arch }} \ | ||
| PACKAGES_ALLARCH="${{ matrix.packages_allarch }}" | ||
|
|
||
| - name: Build riscv64 packages only | ||
| id: build-riscv64 | ||
| if: matrix.arch == 'riscv64' | ||
| continue-on-error: true | ||
| working-directory: debian | ||
| run: | | ||
| make -k packages \ | ||
| TARGET_ARCH=${{ matrix.arch }} \ | ||
| PACKAGES="cartesi-machine-guest-tools" | ||
|
|
||
| - name: Test riscv64 packages only | ||
| id: test-riscv64 | ||
| if: matrix.arch == 'riscv64' | ||
| continue-on-error: true | ||
| working-directory: debian | ||
| run: | | ||
| make -k test \ | ||
| TARGET_ARCH=${{ matrix.arch }} \ | ||
| PACKAGES="cartesi-machine-guest-tools" | ||
|
|
||
| - name: Export builder container image | ||
| run: docker save cartesi/deb-builder-${{ matrix.arch }} | gzip > /tmp/deb-builder-${{ matrix.arch }}.tar.gz | ||
|
|
||
| - name: Upload builder container image | ||
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | ||
| with: | ||
| name: image-deb-builder-${{ matrix.arch }} | ||
| path: /tmp/deb-builder-${{ matrix.arch }}.tar.gz | ||
| compression-level: 0 | ||
|
|
||
| - name: Upload artifacts | ||
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | ||
| with: | ||
| name: artifacts-apt-${{ matrix.arch }} | ||
| path: cdn/apt | ||
|
|
||
| debian-sign: | ||
| runs-on: ubuntu-24.04 | ||
| name: Debian Signing | ||
| needs: [debian-build] | ||
| #FIXME: uncoment when have final signing key | ||
| #if: (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) | ||
| environment: signing | ||
| steps: | ||
| - name: Checkout source code | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| submodules: recursive | ||
|
|
||
| - name: Download apt artifacts | ||
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||
| with: | ||
| pattern: artifacts-apt-* | ||
| path: cdn/apt/ | ||
| merge-multiple: true | ||
|
|
||
| - name: Download builder images | ||
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||
| with: | ||
| pattern: image-deb-builder-amd64 | ||
| path: /tmp/images | ||
|
|
||
| - name: Import builder images | ||
| run: find /tmp/images -name '*.tar.gz' | xargs -I {} docker image load --input {} | ||
|
|
||
| - name: Import GPG signing key | ||
| working-directory: debian | ||
| env: | ||
| DEB_KEY: ${{ secrets.DEB_KEY }} | ||
| run: | | ||
| mkdir -p key | ||
| chmod 700 key | ||
| echo "$DEB_KEY" | gpg --homedir "$(pwd)/key" --import | ||
|
|
||
| - name: Make index | ||
| working-directory: debian | ||
| run: make index | ||
|
|
||
| - name: Sign repository | ||
| working-directory: debian | ||
| run: make sign | ||
|
|
||
| - name: Upload artifacts | ||
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | ||
| with: | ||
| name: signed-artifacts-apt | ||
| path: cdn | ||
|
|
||
| publish: | ||
| name: Debian Publish | ||
| needs: debian-sign | ||
| #FIXME: uncoment when process is validated | ||
| #if: startsWith(github.ref, 'refs/tags/v') | ||
| runs-on: ubuntu-24.04 | ||
| permissions: | ||
| id-token: write | ||
| steps: | ||
| - name: Download signed archives | ||
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||
| with: | ||
| name: signed-artifacts-apt | ||
| path: incoming/ | ||
|
|
||
| - name: Write production GPG public key | ||
| env: | ||
| DEB_PUB_KEY: ${{ vars.DEB_PUB_KEY }} | ||
| run: | | ||
| mkdir -p incoming/apt/keys | ||
| echo "$DEB_PUB_KEY" > incoming/apt/keys/cartesi-deb-key.gpg | ||
| echo "$DEB_PUB_KEY" | gpg --dearmor -o incoming/apt/keys/cartesi-deb-key.gpg.bin | ||
|
|
||
| - name: Configure AWS credentials | ||
| uses: aws-actions/configure-aws-credentials@e6de054238d6b7531b4efff3b6587d9aade6a06c # v6.2.3 | ||
| with: | ||
| role-to-assume: ${{ secrets.DIST_S3_ROLE_ARN }} | ||
| aws-region: us-east-1 | ||
|
|
||
| - name: Publish to S3 | ||
| run: aws s3 cp incoming/apt "s3://${{ secrets.DIST_S3_BUCKET_NAME }}/linux/apt" --recursive |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| cdn | ||
| key |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,12 @@ | ||
| # linux-packages | ||
| Cartesi Linux Packages Repository | ||
| # Cartesi Linux Packages | ||
|
|
||
| Cartesi Linux packages repository, containing packaging for: | ||
|
|
||
| - Debian 13 (Trixie) - Host and Guest | ||
| - Ubuntu 24.04 LTS (Noble) - Host and Guest | ||
| - Alpine Linux 3.23 - Host and Guest | ||
|
|
||
| Debian/Ubuntu packages are available in [debian](debian) subdirectory. | ||
| Alpine packages are available in [alpine](alpine) subdirectory. | ||
|
|
||
| You can find instructions on the sub directories. | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to create a
LICENSEandAUTHORSfile.Also mention the LICENSE.