Skip to content

[codex] Refresh project usage list (#3072) #45

[codex] Refresh project usage list (#3072)

[codex] Refresh project usage list (#3072) #45

Workflow file for this run

name: Publish
on:
push:
tags:
- '**'
env:
dists-artifact-name: python-package-distributions
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
- name: Build package
run: uv build --python 3.13 --python-preference only-managed --sdist --wheel . --out-dir dist
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: ${{ env.dists-artifact-name }}
path: dist/*
release:
name: Publish package to PyPI
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/datamodel-code-generator/${{ github.ref_name }}
permissions:
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: ${{ env.dists-artifact-name }}
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.13.0
with:
attestations: true
push_to_registry:
name: Push Docker image to Docker Hub
if: "success() && startsWith(github.ref, 'refs/tags/')"
runs-on: ubuntu-24.04
needs: release
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: koxudaxi/datamodel-code-generator
tag-semver: |
{{raw}}
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build and push
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
build-args: |
VERSION=${{ github.ref_name }}
platforms: linux/amd64,linux/arm64