Skip to content

Publish

Publish #178

Workflow file for this run

name: Publish
on:
push:
branches:
- "pub/*"
schedule:
- cron: "0 1 * * *"
concurrency:
group: onediff-pub-${{ github.ref }}
cancel-in-progress: true
jobs:
publish:
if: github.repository == 'siliconflow/onediff'
runs-on: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get current date
id: date
run: |
sed -i '1d' "src/onediff/__init__.py"
sed -i '1d' "onediff_diffusers_extensions/onediffx/__init__.py"
formatted_date=$(date +'%Y%m%d%H%M')
echo "__version__ = \"1.2.0.dev${formatted_date}\"" >> src/onediff/__init__.py
echo "__version__ = \"1.2.0.dev${formatted_date}\"" >> onediff_diffusers_extensions/onediffx/__init__.py
- run: cat src/onediff/__init__.py
- run: python3 -m pip install build
- run: python3 -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- run: python3 -m build
working-directory: ./onediff_diffusers_extensions
- name: Publish extension
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN_ONEDIFF_X }}
packages_dir: ./onediff_diffusers_extensions/dist