Skip to content

Commit

Permalink
Merge branch 'ci'
Browse files Browse the repository at this point in the history
  • Loading branch information
WillB97 committed Aug 25, 2024
2 parents bb3ab83 + 7516a98 commit 6f30a4a
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 2 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
if: always()
with:
name: wheels
path: dist
42 changes: 42 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -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 }}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6f30a4a

Please sign in to comment.