Skip to content

Commit

Permalink
Build all active ruby versions
Browse files Browse the repository at this point in the history
  • Loading branch information
dedene committed Jul 4, 2024
1 parent 07bfe77 commit a7378a2
Showing 1 changed file with 19 additions and 22 deletions.
41 changes: 19 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ['3.0', '3.1']
ruby: ['3.0', '3.1', '3.2', '3.3']
os: [ubuntu-latest, ubuntu-22.04-arm-2-core]
include:
- os: ubuntu-latest
platform: linux/amd64
platform: amd64
- os: ubuntu-22.04-arm-2-core
platform: linux/arm64
platform: arm64

permissions:
id-token: write # keyless Cosign signatures
Expand All @@ -39,11 +39,6 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4

- name: Prepare
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
- name: Parse ruby version
id: prepare
run: |
Expand Down Expand Up @@ -107,11 +102,13 @@ jobs:
BUILD_AT=${{ steps.prepare.outputs.today }}
RUBY=${{ matrix.ruby }}
DEBIAN=bullseye
platforms: ${{ matrix.platform }}
platforms: linux/${{ matrix.platform }}
outputs: |
type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
cache-from: type=registry,ref=${{ env.REGISTRY_IMAGE }}:buildcache
cache-to: type=registry,ref=${{ env.REGISTRY_IMAGE }}:buildcache,mode=max
cache-from: |
type=registry,ref=${{ env.REGISTRY_IMAGE }}:buildcache-${{ matrix.platform }}-${{ matrix.ruby }}
cache-to: |
type=registry,ref=${{ env.REGISTRY_IMAGE }}:buildcache-${{ matrix.platform }}-${{ matrix.ruby }},mode=max
- name: Export digest
run: |
Expand All @@ -122,26 +119,18 @@ jobs:
- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: digests-${{ matrix.ruby }}-${{ env.DEBIAN }}-${{ env.PLATFORM_PAIR }}
name: digests-${{ matrix.ruby }}-${{ env.DEBIAN }}-${{ matrix.platform }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1

# - name: Sign container images
# run: |
# cosign sign --yes --recursive "docker.io/$IMAGE_NAME@$IMAGE_DIGEST"
# cosign sign --yes --recursive "ghcr.io/$IMAGE_NAME@$IMAGE_DIGEST"
# env:
# IMAGE_NAME: ${{ env.REGISTRY_IMAGE }}
# IMAGE_DIGEST: ${{ steps.build.outputs.digest }}

merge:
name: Generating Manifest for Ruby ${{ matrix.ruby }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ['3.0', '3.1']
ruby: ['3.0', '3.1', '3.2', '3.3']

needs:
- build
Expand Down Expand Up @@ -213,4 +202,12 @@ jobs:
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.metadata.outputs.version }}
# - name: Sign container images
# run: |
# cosign sign --yes --recursive "docker.io/$IMAGE_NAME@$IMAGE_DIGEST"
# cosign sign --yes --recursive "ghcr.io/$IMAGE_NAME@$IMAGE_DIGEST"
# env:
# IMAGE_NAME: ${{ env.REGISTRY_IMAGE }}
# IMAGE_DIGEST: ${{ steps.build.outputs.digest }}

0 comments on commit a7378a2

Please sign in to comment.