From 7354349f08eb0519fc4bfed5eaa4566962bb90b9 Mon Sep 17 00:00:00 2001 From: Mark Towers Date: Tue, 7 May 2024 09:54:56 +1200 Subject: [PATCH] Fix the release CI (#525) --- .../docker}/manylinux-vcpkg.Dockerfile | 5 +-- .github/workflows/release.yml | 2 - .github/workflows/wheels.yml | 44 ++++++++++++------- docker/docker-bake.hcl | 19 -------- pyproject.toml | 3 +- 5 files changed, 31 insertions(+), 42 deletions(-) rename {docker => .github/docker}/manylinux-vcpkg.Dockerfile (69%) delete mode 100644 docker/docker-bake.hcl diff --git a/docker/manylinux-vcpkg.Dockerfile b/.github/docker/manylinux-vcpkg.Dockerfile similarity index 69% rename from docker/manylinux-vcpkg.Dockerfile rename to .github/docker/manylinux-vcpkg.Dockerfile index 10f1c0719..add3bce6a 100644 --- a/docker/manylinux-vcpkg.Dockerfile +++ b/.github/docker/manylinux-vcpkg.Dockerfile @@ -1,7 +1,6 @@ -ARG BASE_IMAGE -FROM ${BASE_IMAGE} +FROM quay.io/pypa/manylinux2014_x86_64 -LABEL org.opencontainers.image.source https://github.com/mgbellemare/Arcade-Learning-Environment +LABEL org.opencontainers.image.source https://github.com/Farama-Foundation/Arcade-Learning-Environment RUN yum install -y curl unzip zip tar diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ed12d7c45..04aae2f98 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,8 +19,6 @@ jobs: - name: Unzip wheels asset run: | unzip wheels.zip -d dist - - name: Download and unpack ROMs - run: ./scripts/download_unpack_roms.sh - name: Publish to PyPi uses: pypa/gh-action-pypi-publish@release/v1 with: diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 028d3b9e1..bcbbd5385 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -26,33 +26,44 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup Docker - if: runner.os == 'Linux' - run: docker login ghcr.io --username "${GITHUB_ACTOR}" --password "${GITHUB_CR_TOKEN}" - env: - GITHUB_CR_TOKEN: ${{ secrets.CR_TOKEN }} + - name: Set up Docker Buildx + if: runner.os == 'linux' + id: buildx + uses: docker/setup-buildx-action@v1 + with: + install: true - - name: Setup msbuild - if: runner.os == 'Windows' - uses: microsoft/setup-msbuild@v2 + - name: Build Docker image with vcpkg + if: runner.os == 'linux' + # using build-push-action (without push) to make use of cache arguments + uses: docker/build-push-action@v2 + with: + context: . + file: .github/docker/manylinux-vcpkg.Dockerfile + tags: manylinux-vcpkg:latest + push: false + load: true + - uses: microsoft/setup-msbuild@v2 + if: runner.os == 'Windows' # TODO(jfarebro): 02/16/2023 - There's a bug where pkg-config isn't installed on the macOS # runner. See: https://github.com/actions/runner-images/pull/7125 - name: Install pkg-config on macOS if: runner.os == 'macOS' run: brew install pkg-config - - name: Setup vcpkg - if: runner.os == 'macOS' || runner.os == 'Windows' - uses: lukka/run-vcpkg@v11 + - uses: lukka/run-vcpkg@v11 with: vcpkgGitCommitId: "8150939b69720adc475461978e07c2d2bf5fb76e" # There's a permissions issue with the cache # https://github.com/microsoft/vcpkg/issues/20121 doNotCache: true + - name: Download and unpack ROMs + run: ./scripts/download_unpack_roms.sh + - name: Build wheels - uses: pypa/cibuildwheel@v2.12.0 + uses: pypa/cibuildwheel@v2.17.0 env: CIBW_ARCHS: "${{ matrix.arch }}" @@ -62,11 +73,12 @@ jobs: name: wheels path: ./wheelhouse/*.whl - pypi: name: Deploy wheels to PyPi test runs-on: ubuntu-latest needs: build + permissions: + id-token: write steps: - uses: actions/download-artifact@v1 with: @@ -82,9 +94,9 @@ jobs: with: user: __token__ password: ${{ secrets.PYPI_TEST_TOKEN }} - repository_url: https://test.pypi.org/legacy/ - packages_dir: wheels/ - print_hash: true + repository-url: https://test.pypi.org/legacy/ + packages-dir: wheels/ + print-hash: true release: diff --git a/docker/docker-bake.hcl b/docker/docker-bake.hcl deleted file mode 100644 index a0c89a7da..000000000 --- a/docker/docker-bake.hcl +++ /dev/null @@ -1,19 +0,0 @@ -group "default" { - targets = [] -} - -variable "MANYLINUX_VERSION" { - default = "2014" -} - -variable "MANYLINUX_ARCH" { - default = "x86_64" -} - -target "manylinux-vcpkg" { - tags = ["ghcr.io/jessefarebro/manylinux${MANYLINUX_VERSION}_${MANYLINUX_ARCH}-vcpkg"] - dockerfile = "manylinux-vcpkg.Dockerfile" - args = { - BASE_IMAGE = "quay.io/pypa/manylinux${MANYLINUX_VERSION}_${MANYLINUX_ARCH}" - } -} diff --git a/pyproject.toml b/pyproject.toml index 62f46c347..7d1b9c2b0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -70,8 +70,7 @@ skip = ["*-win32", "*i686", "pp*", "*-musllinux*"] build-frontend = "build" -# vcpkg manylinux images -manylinux-x86_64-image = "ghcr.io/jessefarebro/manylinux2014_x86_64-vcpkg" +manylinux-x86_64-image = "manylinux-vcpkg:latest" [tool.cibuildwheel.linux] environment-pass = ["GITHUB_REF"]