Skip to content

release

release #40

Workflow file for this run

name: Release
on:
push:
tags:
- '**' # this is guarded by samuelcolvin/check-python-version, which checks that the tag matches the version
workflow_dispatch:
inputs:
publish_dist_test:
description: 'Publish distribution to Test PyPI'
required: true
default: true
type: boolean
publish_dist:
description: 'Publish distribution to PyPI'
required: true
default: true
type: boolean
skip_env_check:
description: 'Skip tag check'
required: true
default: false
type: boolean
skip_code_checks:
description: 'Skip code checks'
required: true
default: false
type: boolean
jobs:
check-frontend:
uses: ./.github/workflows/check-frontend.yml
with:
force: ${{ github.event.inputs.skip_code_checks != true && github.event.inputs.skip_code_checks != 'true' }}
check-python:
uses: ./.github/workflows/check-python.yml
with:
force: ${{ github.event.inputs.skip_code_checks != true && github.event.inputs.skip_code_checks != 'true' }}
pytest:
uses: ./.github/workflows/pytest.yml
with:
force: ${{ github.event.inputs.skip_code_checks != true && github.event.inputs.skip_code_checks != 'true' }}
build:
runs-on: ubuntu-22.04
needs: [check-frontend, check-python, pytest]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup python
uses: ./.github/actions/setup-python
- name: Install python build
run: pip install --upgrade build
- uses: samuelcolvin/check-python-version@v4
id: check-python-version
with:
skip_env_check: ${{ github.event.inputs.skip_env_check }}
version_file_path: invokeai/version/invokeai_version.py
- name: Setup frontend
uses: ./.github/actions/setup-frontend
- name: Run create_installer.sh
id: create_installer
run: ./create_installer.sh --skip_frontend_checks
working-directory: installer
- name: Upload installer artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.create_installer.outputs.INSTALLER_FILENAME }}
path: ${{ steps.create_installer.outputs.INSTALLER_PATH }}
- name: Upload python distribution artifact
uses: actions/upload-artifact@v4
with:
name: dist
path: ${{ steps.create_installer.outputs.DIST_PATH }}
testpypi-publish:
runs-on: ubuntu-22.04
needs: [build]
environment:
name: testpypi
url: https://test.pypi.org/p/invokeai
steps:
- uses: actions/checkout@v4
- name: Download distribution from build job
if: github.event.inputs.publish_dist_test == 'true'
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Publish distribution to TestPyPI
if: github.event.inputs.publish_dist_test == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
pypi-publish:
runs-on: ubuntu-22.04
needs: [testpypi-publish]
environment:
name: pypi
url: https://pypi.org/p/invokeai
steps:
- uses: actions/checkout@v4
- name: Download distribution from build job
if: github.event.inputs.publish_dist == 'true'
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Publish distribution to PyPI
if: github.event.inputs.publish_dist == 'true'
uses: pypa/gh-action-pypi-publish@release/v1