Publish #360
This file contains 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
name: Publish | |
on: | |
release: | |
types: [published] | |
pull_request: | |
push: | |
branches: | |
- master | |
schedule: | |
# Every Wednesday on 01:32 UTC. This timing is handy because while | |
# European countries are in midnight, American countries are still in | |
# their evening and Asian countries are in the next morning. | |
- cron: '32 1 * * 3' | |
jobs: | |
push: | |
strategy: | |
fail-fast: false | |
matrix: | |
# Ruby 3.4 requires BASERUBY 3.0 | |
entry: | |
- { os: 'lunar', tag: 'gcc-13', extras: 'g++-13' } | |
- { os: 'jammy', tag: 'gcc-12', extras: 'g++-12' } | |
- { os: 'jammy', tag: 'gcc-11', extras: 'g++-11' } | |
- { os: 'jammy', tag: 'gcc-10', extras: 'g++-10' } | |
- { os: 'jammy', tag: 'gcc-9', extras: 'g++-9' } | |
- { os: 'focal', tag: 'gcc-8', extras: 'g++-8' } | |
- { os: 'focal', tag: 'gcc-7', extras: 'g++-7' } | |
- { os: 'jammy', tag: 'clang-20', extras: 'llvm-20' } | |
- { os: 'jammy', tag: 'clang-19', extras: 'llvm-19' } | |
- { os: 'jammy', tag: 'clang-18', extras: 'llvm-18' } | |
- { os: 'jammy', tag: 'clang-17', extras: 'llvm-17' } | |
- { os: 'jammy', tag: 'clang-16', extras: 'llvm-16' } | |
- { os: 'jammy', tag: 'clang-15', extras: 'llvm-15' } | |
- { os: 'jammy', tag: 'clang-14', extras: 'llvm-14' } | |
- { os: 'jammy', tag: 'clang-13', extras: 'llvm-13' } | |
- { os: 'focal', tag: 'clang-12', extras: 'llvm-12' } | |
- { os: 'focal', tag: 'clang-11', extras: 'llvm-11' } | |
- { os: 'focal', tag: 'clang-10', extras: 'llvm-10' } | |
- { os: 'focal', tag: 'clang-9', extras: 'llvm-9' } | |
- { os: 'focal', tag: 'clang-8', extras: 'llvm-8' } | |
- { os: 'focal', tag: 'clang-7', extras: 'llvm-7' } | |
- { os: 'focal', tag: 'clang-6.0', extras: 'llvm-6.0' } | |
- { os: 'jammy', tag: 'mingw-w64' } | |
- { os: 'jammy', tag: 'crossbuild-essential-arm64' } | |
- { os: 'jammy', tag: 'crossbuild-essential-ppc64el' } | |
- { os: 'jammy', tag: 'crossbuild-essential-s390x' } | |
name: ${{ matrix.entry.tag }} ${{ matrix.entry.build_ruby != '' && 'build' || 'system' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: docker/setup-qemu-action@v3 | |
- uses: docker/setup-buildx-action@v3 | |
- uses: docker/login-action@v3 | |
with: | |
username: ${{ github.actor }} | |
password: ${{ secrets.ACCESS_TOKEN }} | |
registry: ghcr.io | |
if: ${{ github.actor != 'dependabot[bot]' }} | |
- name: Resolve build_ruby version | |
uses: ruby/setup-ruby@7bae1d00b5db9166f4f0fc47985a3a5702cb58f0 # v1.197.0 | |
with: | |
ruby-version: '${{ matrix.entry.build_ruby }}' | |
bundler: none | |
if: ${{ matrix.entry.build_ruby != '' }} | |
- name: Set build_ruby version | |
id: build_ruby | |
run: ruby -e 'puts "version=#{RUBY_VERSION}"' >> $GITHUB_OUTPUT | |
if: ${{ matrix.entry.build_ruby != '' }} | |
- uses: docker/build-push-action@v6 | |
with: | |
build-args: | | |
version=${{ matrix.entry.os }} | |
build_ruby=${{ steps.build_ruby.outputs.version }} | |
system_ruby=${{ matrix.entry.system_ruby }} | |
packages=${{ matrix.entry.tag }} ${{ matrix.entry.extras }} | |
cache-from: type=gha,mode=max | |
cache-to: type=gha,mode=max,ignore-error=true | |
platforms: linux/amd64 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: | | |
ghcr.io/${{ github.repository }}:${{ matrix.entry.tag }} |