name: build & release on: push: tags: - 'v*' workflow_dispatch: inputs: skip_code_checks: description: 'Skip code checks (disables publish)' required: true default: true type: boolean jobs: frontend-checks: if: github.event.inputs.skip_code_checks != 'true' runs-on: ubuntu-latest steps: - name: run-frontend-checks uses: ./.github/workflows/frontend-checks.yml frontend-tests: if: github.event.inputs.skip_code_checks != 'true' runs-on: ubuntu-latest steps: - name: run-frontend-tests uses: ./.github/workflows/frontend-tests.yml python-checks: if: github.event.inputs.skip_code_checks != 'true' runs-on: ubuntu-latest steps: - name: run-python-checks uses: ./.github/workflows/python-checks.yml python-tests: if: github.event.inputs.skip_code_checks != 'true' runs-on: ubuntu-latest steps: - name: run-python-tests uses: ./.github/workflows/python-tests.yml check-version: if: github.event.inputs.skip_code_checks != 'true' runs-on: ubuntu-latest steps: - name: checkout uses: actions/checkout@v4 - name: check python version uses: samuelcolvin/check-python-version@v4 id: check-python-version with: version_file_path: invokeai/version/invokeai_version.py build: runs-on: ubuntu-latest timeout-minutes: 15 # expected run time: <10 min steps: - name: checkout uses: actions/checkout@v4 - name: setup python uses: actions/setup-python@v5 with: python-version: '3.10' cache: pip cache-dependency-path: pyproject.toml - name: install pypa/build run: pip install --upgrade build - name: setup frontend uses: ./.github/actions/install-frontend-deps - name: create installer id: create_installer run: ./create_installer.sh working-directory: installer - name: upload python distribution artifact uses: actions/upload-artifact@v4 with: name: dist path: ${{ steps.create_installer.outputs.DIST_PATH }} - name: upload installer artifact uses: actions/upload-artifact@v4 with: name: ${{ steps.create_installer.outputs.INSTALLER_FILENAME }} path: ${{ steps.create_installer.outputs.INSTALLER_PATH }} publish-testpypi: runs-on: ubuntu-latest needs: [ check-version, frontend-checks, frontend-tests, python-checks, python-tests, build, ] if: github.event_name != 'workflow_dispatch' environment: name: testpypi url: https://test.pypi.org/p/invokeai steps: - name: download distribution from build job uses: actions/download-artifact@v4 with: name: dist path: dist/ - name: publish distribution to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 with: repository-url: https://test.pypi.org/legacy/ publish-pypi: runs-on: ubuntu-latest needs: [ check-version, frontend-checks, frontend-tests, python-checks, python-tests, build, ] if: github.event_name != 'workflow_dispatch' environment: name: pypi url: https://pypi.org/p/invokeai steps: - name: download distribution from build job uses: actions/download-artifact@v4 with: name: dist path: dist/ - name: publish distribution to PyPI uses: pypa/gh-action-pypi-publish@release/v1