diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml new file mode 100644 index 0000000..2b6e8d4 --- /dev/null +++ b/.github/workflows/build-wheels.yml @@ -0,0 +1,23 @@ +name: Build Wheels + +on: + push: + +jobs: + build-image: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 + fetch-tags: true + - name: Pull the latest image + run: docker pull ghcr.io/willb97/pyapriltags:latest + - name: Build the wheels + run: docker run --rm -v .:/apriltag -v ./dist:/out ghcr.io/willb97/pyapriltags:latest + - uses: actions/upload-artifact@v4.3.6 + if: always() + with: + name: wheels + path: dist diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..54748b9 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,42 @@ +name: Docker Image CI + +on: + workflow_dispatch: + +env: + IMAGE_NAME: willb97/pyapriltags + +jobs: + build-image: + runs-on: ubuntu-latest + permissions: + packages: write + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 + fetch-tags: true + - name: Generate release version + id: release_version + run: | + echo "WHEEL_VERSION=ghcr.io/$IMAGE_NAME:$(git describe --tags --always),ghcr.io/$IMAGE_NAME:latest" >> "$GITHUB_OUTPUT" + - name: 'Login to GitHub Container Registry' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{github.actor}} + password: ${{secrets.GITHUB_TOKEN}} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ env.IMAGE_NAME }} + - name: Build and push Docker image + id: push + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: ${{ steps.release_version.outputs.WHEEL_VERSION }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index 815da54..6de5f6a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # syntax=docker/dockerfile:1 # get OSX SDK -ARG OSXCROSS_VERSION=latest +ARG OSXCROSS_VERSION=13.1-r0 FROM crazymax/osxcross:${OSXCROSS_VERSION}-ubuntu AS osxcross FROM ubuntu:20.04 diff --git a/Makefile b/Makefile index 66b1efd..33451a2 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ build: mkdir -p ${ROOT}/dist # build wheel docker run \ - -it --rm \ + --rm \ -v ${ROOT}:/apriltag \ -v ${ROOT}/dist:/out \ pyapriltags:wheel-python3