diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 237bdfc89..eead6733e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -102,7 +102,7 @@ jobs: selects=() for target in "${targets[@]}"; do - selects+=(".target == \"${target}\"") + selects+=(".target + (if .sub then \".\" + .sub else \"\" end) == \"${target}\"") done query=$(printf " or %s" "${selects[@]}") query="${query:4}" @@ -130,7 +130,7 @@ jobs: }} matrix: | - { target: x86_64-apple-darwin, os: macos-10.15, cpp: 1, dylib: 1, std: 1, run: 1, deploy: true } - - { target: x86_64-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: native qemu-user qemu-system, deploy: true } + - { target: x86_64-unknown-linux-gnu, sub: "2.17", os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: native qemu-user qemu-system, deploy: true } - { target: x86_64-unknown-linux-musl, os: ubuntu-latest, std: 1, run: 1, deploy: true } - { target: x86_64-pc-windows-msvc, os: windows-2019, cpp: 1, std: 1, run: 1, deploy: true } @@ -209,9 +209,10 @@ jobs: id: build-docker-image if: runner.os == 'Linux' timeout-minutes: 60 - run: ./build-docker-image.sh "${TARGET}" + run: ./build-docker-image.sh "${TARGET}${SUB+.$SUB}" env: TARGET: ${{ matrix.target }} + SUB: ${{ matrix.sub }} shell: bash - name: Set Docker image for test if: steps.build-docker-image.outputs.image diff --git a/build-docker-image.sh b/build-docker-image.sh index bf2b7d0da..875099d17 100755 --- a/build-docker-image.sh +++ b/build-docker-image.sh @@ -20,7 +20,7 @@ pushd docker run() { local push="${1}" local build_args=() - + echo "${1} - ${2}" if "${push}"; then build_args+=(--push) else @@ -28,7 +28,9 @@ run() { fi local dockerfile="Dockerfile.${2}" - local image_name="ghcr.io/cross-rs/${2}" + local name=${2%%.*} + local suffix=${2#*.} + local image_name="ghcr.io/cross-rs/${name}" local tags=() @@ -45,14 +47,14 @@ run() { # Tag stable versions as latest. if ! [[ "${tag_version}" =~ -.* ]]; then - tags+=("${image_name}:latest") + tags+=("${image_name}:latest${suffix:+-${suffix}}") fi ;; branch:*) # Tag active branch as edge. - tags+=("${image_name}:${GITHUB_REF_NAME}") + tags+=("${image_name}:${GITHUB_REF_NAME}${suffix:+-${suffix}}") if ! [[ "${GITHUB_REF_NAME-}" =~ staging ]] && ! [[ "${GITHUB_REF_NAME-}" =~ trying ]]; then - tags+=("${image_name}:edge") + tags+=("${image_name}:edge${suffix:+-${suffix}}") fi ;; *) @@ -62,13 +64,13 @@ run() { fi # Local development. - tags+=("${image_name}:local") + tags+=("${image_name}:local${suffix:+-${suffix}}") ;; esac build_args+=( --pull - --cache-from "type=registry,ref=${image_name}:main" + --cache-from "type=registry,ref=${image_name}:main${suffix:+-${suffix}}" ) if "${push}"; then diff --git a/docker/Dockerfile.x86_64-unknown-linux-gnu b/docker/Dockerfile.x86_64-unknown-linux-gnu.2.17 similarity index 100% rename from docker/Dockerfile.x86_64-unknown-linux-gnu rename to docker/Dockerfile.x86_64-unknown-linux-gnu.2.17